<html>
<body>

<?php

// Validating form data

// stripslashes: removes inserted slashes
// trim: removes trailing and leading whitespace.
/* isset: tests if a variable has a value (including 0, FALSE, or an 
empty string, but not NULL).*/
/* empty: checks if a variable has an empty value (NULL, 0, FALSE, an 
empty string).*/

// isnumeric
// strlen

$name = trim($_REQUEST['Name']);
$country = trim($_REQUEST['Country']);
$age = $_REQUEST['Age'];
$email = trim($_REQUEST['Email']);
$college = $_REQUEST['College'];
$rate = $_REQUEST['Rate'];
$comments = trim(stripslashes($_REQUEST['Comments']));


echo "<B>You've entered:</B><P><BR>\n";

if (!empty($name)) 
// if (isset($name)) // NO
	echo "Name: \"$name\"<P>\n";
else  
	echo "No name entered.<P>\n";

if (!empty($country))
        echo "Country/State: $country<P>\n";
else
        echo "No country entered.<P>\n";
    
echo "Age: $age<P>";

if (!empty($email))
        echo "Email: $email<P>\n";
else
        echo "No email entered.<P>\n";

//if (!empty($college))
if (isset($college))
        echo "College Education? $college<P>\n";
else
        echo "No college education specified.<P>\n";

echo "Iyad's Website is: $rate<P>\n";

if (!empty($comments))
        echo "Comments: <PRE>$comments</PRE><P>\n";
else
        echo "No comments entered.<P>\n";

/* Have the following input in your comments text area to see what teh 
output will be with and without stripslashes:

It's summer.
That's good. \/
\\
//

*/

?>

</body>
</html>
