RE: [PHP] WHY will this not work - you must name a button to use it ;-)

From: Date: Mon, 12 May 2003 22:37:14 +0000
Subject: RE: [PHP] WHY will this not work - you must name a button to use it ;-)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-147360@lists.php.net to get a copy of this message
No. you have to name the button. echo "<input type=\"SUBMIT\" name=\"mybutton\" value=\"Submit\">"; Then if(isset($_POST['mybutton'])) { Also, you might check like so... if( isset($_POST['mybutton']) && $_POST['mybutton'] == "Submit" ) { Finally, a really helpful routine to put at the top of your pages is: reset ($_POST); while (list ($key, $val) = each ($_POST)) { //echo "$key => $val<br>\n"; $$key = $val; } So then you could write it as: if( isset($mybutton) && $mybutton == "Submit" ) { > -----Original Message----- > From: Brian V Bonini [mailto:b-bonini@cox.net] > Sent: Monday, May 12, 2003 3:36 PM > To: PHP Lists > Subject: [PHP] WHY will this not work > > > if (isset($admin)) { > echo "<FORM METHOD=\"POST\" ACTION=\"$PHP_SELF\">"; > echo "Enter your Name: <input type=\"text\" > name=\"name\">"; > echo "<input type=\"SUBMIT\" value=\"Submit\">"; > echo"</FORM>"; > } > > if(isset($_POST['Submit'])) { > session_start(); > header("Cache-control: private");// IE 6 Fix. > echo "success"; > } > > When I hit the SUBMIT button if(isset($_POST['Submit'])) > should evaluate > as true right? What am I missing.... > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#147360) next »