RE: [PHP] If... Else.. I'm not getting it!

From: Date: Sat, 25 Jan 2003 11:42:05 +0000
Subject: RE: [PHP] If... Else.. I'm not getting it!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-133095@lists.php.net to get a copy of this message
You are using the post method not get so $_GET[] should be empty. Does this version of your code work? <?php if(isset($_POST['submit'])) { $vname=$_POST['vname']; echo "hello $vname"; } else { ?> <form action="<? echo ($_SERVER['PHP_SELF']); ?>" method=post> <table> <tr><td>Input yourname</td><td><input type=text name=vname></td></tr> <tr><td colspan=2><input type=submit name=submit></td></tr> </table> </form> <?php } ?> Rich -----Original Message----- From: Frank Keessen [mailto:fkeessen@planet.nl] Sent: 25 January 2003 11:33 To: Johannes Schlueter; php-general@lists.php.net Subject: Re: [PHP] If... Else.. I'm not getting it! Hi, Thanks, but i'm a kind of a newbie in PHP and what i've read it's better to have the register_globals = Off!!! If you look at my code you see that i'm using the $_GET variable.. This works fine!! It's the IF.. ELSE what gives me a lot of trouble! Frank

« previous php.general (#133095) next »