After reading 20+ posts (a large majority of which involve people failing to put the name
attribute in their input
tags), I have a stupidly simple script:
<form action="submit_form.php" method="post">
Name: <input type="text" name="name"><br>
<input type="submit">
</form>
and on submit_form.php
I have
<?php echo $_POST["name"]; ?>
Which spits out the text below.
Notice: Undefined index: name in C:\Users...\PhpstormProjects...\submit_form.php on line 1
I've been using PHP for years though this is the first PHP project on this fresh machine so this is the first post
type action I've tried on the new configuration. With that said, I have a feeling it has to do with my PHP configuration? What should I look for inphpinfo()
?
As a probably very important note:
- I'm running this on PhpStorm
- I've set all the deployment settings (I use PhpStorm at work with no problem)
- After posting the form from the index page, I've had
submit_form.php
only executephpinfo();
and that works except... - I get random 502's... Half of the time I see the PHP info, the other half of the time I get 502 Bad Gateway...
I've also tried:
if(isset($_POST["name"])) {
echo $_POST["name"];
}