bidvertiser

Monday, September 8, 2008

PHP Form handling – POST Method


To receive data from POST method form we can use $_POST[ ] collection.
echo "Your name is: ".$_POST["txtName"]."
";
echo "Your roll number is: ".$_POST["txtRno"]."
";
echo "Your address is: ".$_POST["txtAdrs"]."
";
?>

PHP provides another collection by the name $_REQUEST[ ].
This collection may be used for both the methods; GET & POST.

foreach ($_REQUEST as $key => $value)
{
echo $key."=".$value."
";
}
?>

No comments: