Skip to content Skip to sidebar Skip to footer

Html Form Is Not Sending $_post Values

I am trying to create a form creator in PHP. This is one of them very silly 'need another look' problems. I know this form should work but it just isn't sending any $_POST values a

Solution 1:

Looks like most of the comments are correct.

It seems that the URL that is sending the information requires a trailing slash / or a reference to the direct file.

Thanks for the responses.

Solution 2:

Try to pass full url in action method;

http://projects.zesty-designs.co.uk/orderform/index.php

Solution 3:

You should add .php suffix like action="domain.com/somepage.php" (if it's actually a file name)

Solution 4:

Try to escape your caracters like so :

http:\/\/projects.zesty-designs.co.uk\/orderform

The backslash character has several uses. Firstly, if it is followed by a non-alphanumeric character, it takes away any special meaning that character may have. This use of backslash as an escape character applies both inside and outside character classes.

Check the link for more information : Escape sequences @ Php.net Manual

Basically in PHP your \ character is used for echo'ing out flag or escaping characters

Solution 5:

I was having the exact same problem with classic asp. I have IIS RULE REWRITE and web.config set as follows:

<rulename="arulename"><matchurl="somematch" /><conditions><addinput="{REQUEST_METHOD}"matchType="Pattern"pattern="POST"negate="false" /></conditions><actionredirectType="Temporary"type="Rewrite"url="someurl" /></rule>

my problem was that when I clicked the submit button the form did not submit. my form was perfect action="http://website.extension/someshorturl" but there was no post data. In other words everything was correct but the post data was being lost or dropped and there were no config or coding errors. What I found was that because I had set my server itself that the domain used the www. prefix, it was redirecting everything that came through without the www. prefix first. I simply had to change my form to say action="http://www.website.extension/someshorturl" and the post data appeared.

If anyone ever has the same problem as me, I hope this will help them.

I searched high and low, using "POST DATA BEING LOST" and got no help until I came here and this pointed me to the problem.

Post a Comment for "Html Form Is Not Sending $_post Values"