Re: [PHP] Fwd: variable not being rendered

2004-12-04 Thread Jason Wong
On Sunday 05 December 2004 04:57, Dustin Krysak wrote:

> I did run it... that is the reason I posted. As I stated, When I view
> source, the result is blank.

What *exactly* did you run?

Did you run the code as presented in your previous post? 

 OR

did you run it as you state further down in this post where the "print form" 
part is in a function?

I suspect you're doing the latter (the former should work and if it REALLY 
doesn't you should report it as a major bug), in which case you should be 
ashamed for giving misleading information - stating something doesn't work 
when you're acutally doing something else.

[snip]

> So as you can see the "$editFormAction" is still not being rendered. So
> I am going to add the following info, I have a page that is required
> once that contains my functions. and I defined a function to print out
> this form. My code for that is:
>
>  // create subscribe form
> function sub_form() {
> print ' id="ml_form">'."\n";
> print ' size="25">'."\n";
> print ' value="Subscribe">'."\n";
> print '';
> }
> ?>
>
> So would my issue be that I formatted my function wrong? Or that the
> page is included?

manual > Variables > Variable scope

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Many are called, few volunteer.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Fwd: variable not being rendered

2004-12-04 Thread Dustin Krysak
Answering within the email below
d
On 4-Dec-04, at 3:16 AM, [EMAIL PROTECTED] wrote:
From: Jason Wong <[EMAIL PROTECTED]>
Date: December 4, 2004 12:04:18 AM PST
To: [EMAIL PROTECTED]
Subject: Re: [PHP] variable not being rendered
On Saturday 04 December 2004 15:36, Dustin Krysak wrote:
Hi there, I have some code where I am using the $_SERVER['PHP_SELF']
array to reference my script for a form action... now for some reason
the file name is not being rendered out. I am including only small
snippets of my code to see where my error is...
I know this is not your actual code, but did you actually run this? I 
can't
see any errors in it and it should work fine if you're using a recent 
version
of PHP.
I did run it... that is the reason I posted. As I stated, When I view 
source, the result is blank.



$editFormAction = $_SERVER['PHP_SELF'];
What does print_r($_SERVER) show?
What does print $editFormAction show?
echo $_SERVER['PHP_SELF']; shows the proper result.
print_r($_SERVER['PHP_SELF']); shows the proper result
print $editFormAction ; shows the proper result


print "\n";
As you're not placing variables inside your print statement you might 
as well
use single-quotes:

print ''."\n";
This does away with all the backslashes (which gives me a headache).
Well I changed it to:
print ''."\n";

and I still had the same result. the source of the page when viewed in 
the browser was:


So as you can see the "$editFormAction" is still not being rendered. So 
I am going to add the following info, I have a page that is required 
once that contains my functions. and I defined a function to print out 
this form. My code for that is:


// create subscribe form
function sub_form() {
print ''."\n";
print ''."\n";
print ''."\n";
print '';
}
?>

So would my issue be that I formatted my function wrong? Or that the 
page is included?

Dustin

--
Jason Wong -> Gremlins Associates
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php