Passing variables from HTML to PHP

From: Date: Tue, 31 Aug 2004 20:13:04 +0000
Subject: Passing variables from HTML to PHP
Groups: php.db 
Request: Send a blank email to php-db+get-35973@lists.php.net to get a copy of this message
Hi all. This might be a simple answer, but I'm still not sure what the case is. Okay, so I have a <form> in my html that has some <input>s. These each have a name and a value attribute to them, of course. I cannot seem to access the name/value pair in my php without using the $_POST method/variable names. Are you able to without $_POST? Example: ------------------- html: <input type="checkbox" name="foo" value="bar"> php: do this: echo "foo = " . $foo; // foo = bar or this: echo "foo = " . $_POST["foo"]; // foo = bar ------------------- So, should both of those php examples work the same? Thanks! ~Philip

« previous php.db (#35973) next »