• GoDaddy Community
  • Websites + Marketing | Website Builders
  • Websites + Marketing | Website Builders

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 
    Go to solution
    New

    POST not working, but GET is working. WHY?

    I'm creating forms and have noticed that $_POST isn't working while $_GET works. Here's the sample code, starting with $_POST that doesn't work:

    Code:

    <html>
    <body>

    <form action="" method="post">
    <input type="text" name="var" id="var"><br>
    <input type="submit" name="submit" id="submit">
    </form>

    </body>
    </html>

     

    <?php if(isset($_POST['submit'])){
    $test = $_POST['var'];
    echo $test;
    }
    ?>

     

    Test.php

    1 REPLY 1
    Highlighted
    Community Manager
    Community Manager
    Solution

    Re: POST not working, but GET is working. WHY?

    Hi @kuk. Welcome to GoDaddy Community! I'm not a web developer, but this might have to do with the empty 'action=""' attribute. I found this Quora post that may be of some help to you. If not, others in the community may have additional suggestions. 

     

    JesseW - GoDaddy | Community Manager | 24/7 support available at x.co/247support | Remember to choose a solution and give kudos.