Page 1 of 1
$_REQUEST not getting everything from an HTML Form
Posted: Thu Sep 28, 2006 12:09 pm
by caps_phisto
I have a simple HTML form with 4 input fields. I use "extract" to get the values from these input fields in a php script. However, it does not seem as though PHP is getting all of the data that has been input.
I used "print_r" to print the contents of the Array and voila, only one field is being recieved by the script.
Any suggestions?
Posted: Thu Sep 28, 2006 12:12 pm
by Luke
what are the input fields, are they checkboxes? Post your code... we can't magically diagnose code without seeing it.
Posted: Thu Sep 28, 2006 12:15 pm
by Benjamin
Post your code man, we can speculate all day but code is gold man.
Posted: Thu Sep 28, 2006 12:16 pm
by s.dot
My guess is either an unset value (checkbox or radio) or a file field, which will be in $_FILES.
Posted: Thu Sep 28, 2006 12:17 pm
by caps_phisto
My Bad,
I hadn't read completely through the "Post Code" sticky but I thought I'd ask my question while I did:
Here is the HTML:
Code: Select all
<html>
<head>
<title>NHTI User Registration System</title>
</head>
<body>
<form method="post" action="user_reg.php">
Please Enter your Name:
<input type="text" NAME="name" value="">
<br>
Please Enter your Hall and Room:
<input type="text" HROOM="hroom" value="">
<br>
Please Enter your Phone Number:
<input type="text" PHONE="phone" value="">
<br>
Please Enter your Email Address (Note this is where your User Name and Password will be
sent)
<input type="text" EMAIL="email" value="">
<br>
<input type="submit" value="Submit">
<input type="reset" value="Clear Form">
</form>
</body>
</html>
As a side I am using PHP 5.1.6, Apache 1.3.37.
Thanks again
Posted: Thu Sep 28, 2006 12:20 pm
by s.dot
You're naming your fields wrong. You did the first one right.
It should be....
name="name"
name="hroom"
name="phone"
name="email"
Posted: Thu Sep 28, 2006 12:26 pm
by caps_phisto
Well that's service for you! I have been looking at that code for more than an hour! I am no HTML expert but I am glad I have quickly found a place that has a few set of eyes that are!
Thanks a bunch that worked!