Form variables not working

From: Date: Sat, 16 Nov 2002 16:36:29 +0000
Subject: Form variables not working
Groups: php.general 
Request: Send a blank email to php-general+get-124725@lists.php.net to get a copy of this message
I am havein troubles gettin my form variables to work. The "register_globals" in php.ini is set to its default of "off". code: <HTML> <HEAD> <TITLE>Form Series - Example One</TITLE> </HEAD> <BODY> <? global $PHP_SELF; echo $_POST["answered"]; ?> <form name="forma" action="<?php echo $PHP_SELF ?>" method="post"> asdasdasddassad<br> <input type="hidden" name="answered" value="fred"> <input type="submit"> </form> </body> </html> the <?php echo $PHP_SELF ?> dosent print anything in the action of the form and the echo $_POST["answered"]; on the first run gives an error that says that "answered" is an undefined variable. but on the second submit this error is gone with the submitted data displaying correctly. Im an experianced ASP developer and im getting frustrated with PHP. why is it so dificult to do the simplest things in php? please help with simple forms in php that is configured by default to have "register_globals" set to off. thanks

« previous php.general (#124725) next »