I am making an online order form for the company at which I am an intern, and the form has 23 fields of misc. types. When the end user hits submit, the form.html posts data to process.php. The issue I am having is that the data from all of my fields gets posted, except for the data from one field. I have checked my spelling and stuff, and the php code looks valid. Below is the relevant code from both files, and thank you in advance for your help.
form.html full file here http://pastebin.com/MRwE8jE3
<li id="li_8" >
<label class="description" for="prefangle">Preferred Angles </label>
<div>
<textarea id="prefangle" name="prefangle" class="element textarea medium"></textarea>
</div>
</li>
process.php full file here http://pastebin.com/bSfHbt16
<tr><td>Preferred Angles: </td><td>".$_POST['prefangle']."</td></tr>
Any and all help is appreciated.
For unknown reason, I couldn't add a comment to your question (O.O) so I'm posting it as answer (tho I do not consider it as answer, just a tip)
However, on the top of process.php, add
print_r($_POST);
And you'll see all the data passedby POST request :)
Make sure that the <textarea>
is inside the <form>
where the action submits it to process.php.
For debugging, you can add var_dump($_POST);
on process.php file to see if there is really a $_POST['prefangle']
being submitted.
Ok, so I found the problem and I feel incredibly stupid. In order to save time during testing, I always hit the back button so I would not have to re-enter all of the fields. Turns out, that was the issue. It was using an old, invalid version of the html page, and thus could not post properly. Sorry for wasting your time, everyone! If you want more details, go under comments on the question.