Possible Duplicate:
php $_POST array empty upon form submission
I just make a simple test to POST a HTML format's textfield data to PHP server. And, in PHP server side, just use the $_POST[] function to retrive the posted data. However, there is empty(null) data recevied always. Attached below are the HTML code and php script I tested. Appreaicted if you can point me where I was wrong?
----HTML code--- senddata.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<title>Untitled Document</title>
</head>
<body>
<form action="receivedata.php" method="post" enctype="application/x-www-form-urlencoded" name="form1" id="form1">
<label>_id
<input name="_id" type="text" id="_id" />
</label>
<br />
<label>Send
<input type="submit" name="Submit" value="Send" />
</label>
</form>
</body>
</html>
---PHP Script----- receivedata.php
<?php
echo $_SERVER['SERVER_NAME']."<BR/>" ;
$id = $_post['_id'];
if ( isset($id))
{
echo "Data set ready!<br/>";
echo "id=".$id."<br/>";
}
else
{
echo "Data set is not ready!<br>";
}
?>
and the result display on the browser:
192.168.0.108
Data set is not ready!