Forum Moderators: coopster
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=utf-8" />
<title>Simple Html form</title>
</head>
<body>
<form action="handle_form.php" method="post">
<fieldset><legend>Enter your information in the form below:</legend>
<p><b>Name:</b><input type="text" name="name" id="name" size="20" maxlength="40" /></p>
<p><b>Email Adress:</b> <input type="text" name="email" id="name" size="40" maxlength="60" /></p>
<p><b>Gender:</b><input type="radio" name="gender" id="gender" value="M" />Male<input type="radio" name="gender" id="gender" value="F" />Female</p>
<p><b>Age:</b><select name="age">
<option value="0-29">Under 30</option>
<option value="30-60">Betwen 30 and 60</option>
<option value="60+">Over 60</option></select></p>
<p><b>Comments:</b><textarea name="comments" id="comments" rows="3" cols="40"></textarea></p>
</fieldset>
<div align="center"><input type="submit" name="submit" value="Submit my information" /></div>
</form>
</body>
</html>
PHP:
<!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=utf-8" />
<title>Handle form</title>
</head>
<body>
<?php
//Creaza o forma prescurtata pentru datele din formular.
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$comments = $_REQUEST['comments'];
//Nefolositeage, gender, submit
//Afiseaza informatiile transmise.
echo "<p>Thank you, <b>" . $name . "</b>, for the following comments:<br /><tt>" . $comments . "</tt></p><p>We will reply to you at <i>" . $email . "</i>.</p>";
?>
</body>
</html>
My problem that after I complete this html form it's appearing this(without dates from my form) :
Thank you, " . $name . ", for the following comments:
" . $comments . "
We will reply to you at " . $email . ".
"; ?>
I'm using wamp. Do you know what's the problem, please?
Thank you