I have the following form:
<FORM action="http://url.to.mysite.com/doc.php" method="post">
<INPUT type="text" id="name">
<INPUT type="text" id="id">
<INPUT type="submit" value="Send">
</P>
</FORM>
Unfortunately, whatever is typed into the text fields, the PHP script receives only empty strings in every $_POST
variable. All of the variables are set, just empty. What can be the cause of that?
You are missing the name properties in your html:
You need to add the name attribute to your input tags. Example:
<input type="text" name="name" id="name" />
Only form elements with a
name
attribute will be sent to the PHP script (same with POST) Try this: