Hello All,
I am a PHP newbie and have all my resources set up( by that I mean PHP,Apache server etc all working fine)
I have an html file and a PHP script to handle the inputs from the html form. However when I hit submit to send the data to the PHP script I get a blank page.
Below are my files.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN " "http://www.w3.org/TR/2000/REC -xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns ="http://www.w3.org/1999/xhtml" xml :lang="en" lang ="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<title>HTML Form</title>
</head>
<body>
<!--Script 2.1 -from.html -->
<form action = "handle_form.php " method="post">
<fieldset><legend> Enter you information in the form below :</legend>
<p><b>Name :</b> <input type = "text" name = "name" size ="20" maxlength = "40"/></p>
<p><b>Email :</b> <input type = "text" name ="email" size="40" maxlength ="40"/></p>
<p><b>Gender :</b> <input type = "radio" name ="gender" value ="M" />Male
<input type = "radio" name ="gender" value ="F" />Female
</p>
<p><b>Age :</b>
<select name = "age" >
<option value ="0-30">Under 30</option>
<option value ="30-60">Between 30 and 60</option>
<option value ="60+">Over 60 </option>
</select></p>
<p><b>Comments :</b><textarea name = "comments" rows ="3" cols="50"></textarea></p>
</fieldset>
<div align = "center"><input type = "submit" name ="submit" value ="Submit Information"/><div>
</form>
****...and here is the PHP script handling the form above*************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN " "http://www.w3.org/TR/2000/REC -xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns ="http://www.w3.org/1999/xhtml" xml :lang="en" lang ="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<title>Form Feedback</title>
</head>
<body>
<? php # Script 2.2 -handle_form.php
echo "<p> Thank you ,<b>$name</b> for the following comments :<br/><tt>$comments</tt><p>We will reply to you at <i>$email</i>.</p>";
?>
</body>
</html>
I'd be grateful if some can explain why the handle_form.php shows up BLANK when I clik submit from the form.html.
Thank You.