0

I'm trying to make a form for a user signup page however when I submit the form I keep getting a blank array. When I switched method="post" to method="get" the array was filled with the appropriate values. I have no idea what is going on!

index.html

<form action="config.php" method="POST">
    <input type="text" name="firstname" placeholder="First Name">
    <input type="text" name="lastname" placeholder="Last Name">
    <input type="text" name="email" placeholder="Email">
    <div class="select">
        <select name="status">
            <option selected="selected" disabled='disabled'>Status</option>
            <option value="student">Student</option>
                                <option value="faculty">Faculty</option>
            <option value="alumni">Alumni</option>
        </select>
    </div>
    <div style="text-align: center">
        <input type="submit" name="submit" value="Sign Up" class="btn large color wow center fadeInLeft">
    </div>
</form>

config.php

print_r($_POST);

Result

Array ( )

Qirel
  • 25,449
  • 7
  • 45
  • 62
  • 2
    Works for me, tried and tested it. Might be a configuration issue? – Qirel Feb 16 '17 at 18:25
  • Yeah there's no reason this wouldn't work. Check your browser inspector, make sure it's actually posting. Check your PHP for typos -- make sure you're not still printing out `$_GET`. – miken32 Feb 16 '17 at 18:27
  • Do you think it might be from my local host? I'm using aws for the backend. –  Feb 16 '17 at 18:32

0 Answers0