Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Need some help with an HTML form?

I have an html form which is giving me fits. I can't tell if the error is happening on the form its self, or on the processing page.

For some reason the processing page is not receiving the form data when the form method is set to POST. However, it receives the data when the method is set to GET.

The <form> tag is correctly in place, and the action directs to the correct page. The </form> tag is also correctly in place.

The processing page has "extract("$HTTP_POST_VARS")" as the first line inside the opening php tag. And I am having no issues with a similar form which I used as a template.

I don't want to post my code here because it contains confidential information, but I'm looking for ideas on what could cause this to fail.

6 Answers

Relevance
  • Jeff P
    Lv 7
    5 years ago
    Favorite Answer

    $HTTP_POST_VARS was deprecated from PHP years ago. You should be using the global $_POST array instead. This is probably why you're not able to get the data from the form.

  • Chris
    Lv 7
    5 years ago

    So I take it you solved this? Because what you describe sounds weird.

    The processing page is refreshing to retrieve the variable? What...?

    If is still doesn't work, post your code and simply remove the confidential info beforehand.

  • 5 years ago

    To stop complications, what you could do it just print the $_POST or $_GET of each field from your form on the receiving PHP page?

    If this is in pure PHP, you would set it up like this.

    <form action="recv.php" method="post">

    <input type="text" name="name">

    <input type="text" name="age">

    <input type="submit" name="submit" value="Go">

    </form>

    so thats your form, then you have your php set like this.

    <?php

    if(isset($_POST['name']) && isset($_POST['age']))

    {

    echo $_POST['name'] . "<br>";

    echo $_POST['age'] . "<br>";

    }

    ?>

    That should work perfectly fine, if it doesn't tell me the error it gives in case I made a typo.

  • Anonymous
    5 years ago

    Can't see the code 🙀

  • How do you think about the answers? You can sign in to vote the answer.
  • 5 years ago

    yes

  • 5 years ago

    You can use laracast tutotials

Still have questions? Get your answers by asking now.