$_REQUEST not getting everything from an HTML Form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
caps_phisto
Forum Newbie
Posts: 3
Joined: Thu Sep 28, 2006 12:04 pm

$_REQUEST not getting everything from an HTML Form

Post 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?
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

what are the input fields, are they checkboxes? Post your code... we can't magically diagnose code without seeing it.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Post your code man, we can speculate all day but code is gold man.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

My guess is either an unset value (checkbox or radio) or a file field, which will be in $_FILES.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
caps_phisto
Forum Newbie
Posts: 3
Joined: Thu Sep 28, 2006 12:04 pm

Post 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
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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"
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
caps_phisto
Forum Newbie
Posts: 3
Joined: Thu Sep 28, 2006 12:04 pm

Post 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!
Post Reply