Re: Forms
| From: | Chris Hewitt | Date: | Wed, 11 Dec 2002 10:06:57 +0000 |
| Subject: | Re: Forms | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-127778@lists.php.net to get a copy of this message | ||
Beauford.2002 wrote:
--------------------------snip----------------------- The problem is that the form is not sending the employee name to the php page. If I insert the name in the php page manually, it works fine, so the problem appears to be with the form. --------------------------snip---------------------------------- <P><CENTER><FORM NAME="Employees"> <SELECT NAME="name"> <OPTION SELECTED VALUE=""></OPTION> <OPTION VALUE="John"</OPTION>John <OPTION VALUE="Mary"</OPTION>Mary </SELECT> <INPUT TYPE="submit" VALUE="Submit"> Two suggestions. You do not specify whether your form should use GET or POST method (I'm not sure whether there is a default). The other is how you are accessing the variable "name" within php. If register_globals is on in php.ini then just "$name" is fine, but if its off then use $name = $_GET['name'] or $name = $_POST['name'] depending upon whether you specify GET or POST method.HTH Chris