";
print "
";
print "There are four possible ways in PHP to access the information submitted";
print "by the user through the form in lab6Form.htm.";
print "Two of them are enabled in CS X server. See the following experiments";
print "
";
print "You can access the fields (fine for both the get and the post methods) from _REQUEST array in PHP:.
";
$W = $_REQUEST['FirstName'];
$V = $_REQUEST['LastName'];
print "Use _REQUEST['FirstName'] to access the submitted first name: ".$W."
";
print "Use _REQUEST['LastName'] to access the submitted last name: ".$V."
";
print "
";
print "You can access the fields sent by the post method from _POST array in PHP:.
";
$T = $_POST['FirstName'];
$U = $_POST['LastName'];
print "Use _POST['FirstName'] to access the submitted first name: ".$T."
";
print "Use _POST['LastName'] to access the submitted last name: ".$U."
";
print "
";
print "You CANNOT access the fields as global variables in PHP:.
";
print "Use the global \$FirstName to get your first name: ".$FirstName."
";
print "Use the global \$LastName to get your last name: ".$LastName."
";
print "
";
print "You CANNOT access the fields from _HTTP_POST_VARS array in PHP:.
";
$X = $_HTTP_POST_VARS['FirstName'];
$Y = $_HTTP_POST_VARS['LastName'];
print "Use _HTTP_POST_VARS['FirstName'] to get your first name: ".$X."
";
print "Use _HTTP_POST_VARS['LastName'] to get your last name: ".$Y."
";
?>