Not getting values using $_POST - Please Reply Soon

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pm1ccc
    New Member
    • Feb 2007
    • 1

    #1

    Not getting values using $_POST - Please Reply Soon

    Hi,

    I have written following code and not getting back values in the same form ( i have used phpself)
    [php]
    <?php
    $Fname = $_POST["Fname"];
    $Lname = $_POST["Lname"];
    $gender = $_POST["gender"];
    $food = $_POST["food"];
    $quote = $_POST["quote"];
    $education = $_POST["education"];
    $TofD = $_POST["TofD"];
    ?>
    <html>
    <head>
    <title>Person al INFO</title>
    </head>
    <body>
    <form method="post" action="<?php echo $PHP_SELF;?>">
    First Name:<input type="text" size="12" maxlength="12" name="Fname"><b r />
    Last Name:<input type="text" size="12" maxlength="36" name="Lname"><b r />
    Gender:<br />
    Male:<input type="radio" value="Male" name="gender">< br />
    Female:<input type="radio" value="Female" name="gender">< br />
    Please choose type of residence:<br />
    Steak:<input type="checkbox" value="Steak" name="food[]"><br />
    Pizza:<input type="checkbox" value="Pizza" name="food[]"><br />
    Chicken:<input type="checkbox" value="Chicken" name="food[]"><br />
    <textarea rows="5" cols="20" name="quote" wrap="physical" >Enter your favorite quote!</textarea><br />
    Select a Level of Education:<br />
    <select name="education ">
    <option value="Jr.High" >Jr.High</option>
    <option value="HighScho ol">HighSchoo l</option>
    <option value="College" >College</option></select><br />
    Select your favorite time of day:<br />
    <select name="TofD" size="3">
    <option value="Morning" >Morning</option>
    <option value="Day">Day </option>
    <option value="Night">N ight</option></select><br />
    <input type="submit" value="submit" name="submit">
    </form>[/php]

    Thanks

    Read the Posting Guidelines before you post in this forum!

    Especially the part about enclosing code within code or php tags!!

    moderator
    Last edited by ronverdonk; Feb 19 '07, 10:54 AM. Reason: code within tags and warning
  • newladder
    New Member
    • Jan 2007
    • 15

    #2
    use this, it will solve your problem
    <form method="post" action="<?php $PHP_SELF; ?>">

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      Where did you get the idea that it doesn't work? There is nothing wrong in the passing of the values! They are all passed and assigned to the variables.

      Of course you don't see anything because you don't do anything with the variables, like echoeing or alike.

      Ronald :cool:

      Comment

      Working...