Re: variable not being rendered
| From: | Dustin Krysak | Date: | Sat, 04 Dec 2004 21:09:32 +0000 |
| Subject: | Re: variable not being rendered | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-203495@lists.php.net to get a copy of this message | ||
Ok - I have been investigating a little more. I now realized it is a question of making my variables available outside of the function. So one thing I want to point out is that:
$editFormAction = $_SERVER['PHP_SELF']; is contained in one function.
And that:
print '<form action="'.$editFormAction.'" method="post" name="ml_form" id="ml_form">'."\n"; is contained in another function.
The first function contains all my code for a SQL query to insert a record. And the second function is just to create the form itself.
Now i know i also need to use the "result" function. But I am sure that since I am using a few functions here - there might be more hitches than I realize. So I am just asking for some pointers for dealing with this.
thanks!
d
From: Dustin Krysak <mailinglists@digitalcollision.com> Date: December 3, 2004 11:36:56 PM PST To: PHP <php-general@lists.php.net> Subject: variable not being rendered 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... <?php $editFormAction = $_SERVER['PHP_SELF']; print "<form action=\"".$editFormAction."\" method=\"post\" name=\"ml_form\" id=\"ml_form\">\n"; ?> Now there is much more code, but these are the important points. All I am doing is assigning a variable a value from the $_SERVER array. Then print out a form with PHP, and reference that variable for my form action.... the HTML is rendered as normal. But the form action page is not there when I view my source. I am sure it is a SIMPLE error... But my brain block is getting larger the more i look at this. help cries the newbie! d