I have a form which quite happily works locally on my laptop in both WAMP & XAMPP.
When I use method="post" the values get transfered ok, and likewise the same when I use method="get".
However, when I run the same form on a Windows 2008 Server it works fine with the method="get" (As expected, I can see the values in the URL), but fails to transfer any values when using method="post" i.e.
Wamp = Both "post" & "get" work without a problem.
XAMPP = Both "post" & "get" work without a problem.
Server = Only "get" works. "Post" fails to tranfer any values.
The fact that the form works ok on my laptop when using WAMP or XAMPP leads me to suspect that the Windows Server needs to be configured to allow the use of "post" in forms, or at least to allow form values to be passed i.e. like global variables.
However, I'm not sure if this thinking is correct or whether I simply need to enable something on the server.
VAR_DUMP ( $_POST ); confirms that the array is empty
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en" >
<FORM action="test.php" method="post">
First name: <INPUT type="text" name="firstname"><BR>
Last name: <INPUT type="text" name="lastname"><BR>
email: <INPUT type="text" name="email"><BR>
<INPUT type="radio" name="sex" value="Male"> Male<BR>
<INPUT type="radio" name="sex" value="Female"> Female<BR>
<INPUT type="submit" value="Send"> <INPUT type="reset">
The TEST.PHP File
echo "POST: ";
var_dump( $_POST );
echo "GET: ";
var_dump( $_GET );
Any guru out there know the answer?
What happens if you also provide a name attribute to the submit button?
It works.... cpradio - you are a genius mate
This topic is now closed. New replies are no longer allowed.