$_POST array is empty
Posted: Sun Nov 13, 2011 7:54 pm
I cannot get a submitted form to be put in the $_POST array. The raw string is passed, but $_POST remains empty. To try debugging I tried the minimal example below. Each time I submit, the print_r produces ARRAY()
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>I</title>
</head>
<body>
<?php print_r($_POST); ?>
<form action="temp.php" method="post">
<label>User ID:</label><input name="userid" size="16" type="text" >
<label>Password:</label><input name="password" size="16" type="password"><br><br>
<input name="submit" type="submit" value="Submit">
</form>
</body>
</html>
I tried using the GET method and have the same problem. I see the parameters correctly in the URL display of the browser, but the $_GET array is empty.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>I</title>
</head>
<body>
<?php print_r($_POST); ?>
<form action="temp.php" method="post">
<label>User ID:</label><input name="userid" size="16" type="text" >
<label>Password:</label><input name="password" size="16" type="password"><br><br>
<input name="submit" type="submit" value="Submit">
</form>
</body>
</html>
I tried using the GET method and have the same problem. I see the parameters correctly in the URL display of the browser, but the $_GET array is empty.