Forum Moderators: coopster
In a php page called "widgets.php" I have the following:-
<?
echo "<input name=\"WODGET\" type=\"text\" class=post id=\"wodget\" style=\"WIDTH: 300px\" value=\"".$_POST['wodget']."\">";
?>
The idea is to fill this form object with a wodget variable passed to the script, like this:-
http://www.example.com/widgets.php?wodget=TrillianJedi
It doesn't seem to work. It doesn't create an error, the form text object is displayed, it's just the value is blank rather than "TrillianJedi".
Do I need to initialise something before using $_POST to obtain the passed variables?
Many thanks,
TJ
print '<pre>'; print_r($GLOBALS); exit('</pre>'); Slide that little snippet in where you want to stop processing your script to have a look at things. If you are within a function, you may want to add the get_defined_vars() [php.net] to that list as well -- and you can get much fancier than that, of course, but this is a good start.
You can view more info about this function on the PHP website:
http://uk2.php.net/manual/en/function.print-r.php [uk2.php.net]