Hi,
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
The FORM:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en" >
<head>
</head>
<body>
<FORM action="test.php" method="post">
<P>
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">
</P>
</FORM>
</body></html>
The TEST.PHP File
<?php
echo "POST: ";
var_dump( $_POST );
echo "GET: ";
var_dump( $_GET );
?>
Any guru out there know the answer?
Many thanks,
Pete