feedback.html <!doctype html> <html lang=\"en\"> <head> <meta charset=\"utf-8\">
ID: 3910729 • Letter: F
Question
feedback.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Feedback Form</title>
</head>
<body>
<!-- Script 3.1 - feedback.html -->
<div><p>Please complete this form to submit your feedback:</p>
<form action="handle_form.php">
<p>Name: <select name="title" required>
<option value="Mr.">Mr.</option>
<option value="Mrs.">Mrs.</option>
<option value="Ms.">Ms.</option>
</select> <input type="text" name="name" size="20" required></p>
<p>Email Address: <input type="email" name="email" size="20" required></p>
<p>Response: This is...
<input type="radio" name="response" value="excellent" required> excellent
<input type="radio" name="response" value="okay"> okay
<input type="radio" name="response" value="boring"> boring</p>
<p>Comments: <textarea name="comments" rows="3" cols="30" required></textarea></p>
<input type="submit" name="submit" value="Send My Feedback">
</form>
</div>
</body>
</html>
handle_form.php
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Your Feedback</title>
</head>
<body>
<?php // Script 3.3 handle_form.php
// This page receives the data from feedback.html.
// It will receive: title, name, email, response, comments, and submit in $_POST.
// Create shorthand versions of the variables:
$title = $_POST['title'];
$name = $_POST['name'];
$response = $_POST['response'];
$comments = $_POST['comments'];
// Print the received data:
print "<p>Thank you, $title $name, for your comments.</p>
<p>You stated that you found this example to be '$response' and added:<br>$comments</p>";
?>
</body>
</html>
Explanation / Answer
If you have any doubts, please give me comment...
feedback.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Feedback Form</title>
</head>
<body>
<!-- Script 3.1 - feedback.html -->
<div><p>Please complete this form to submit your feedback:</p>
<form action="handle_form.php" method="POST">
<p>Name: <select name="title" required>
<option value="Mr.">Mr.</option>
<option value="Mrs.">Mrs.</option>
<option value="Ms.">Ms.</option>
</select> <input type="text" name="name" size="20" required></p>
<p>Email Address: <input type="email" name="email" size="20" required></p>
<p>Response: This is...
<input type="radio" name="response" value="excellent" required> excellent
<input type="radio" name="response" value="okay"> okay
<input type="radio" name="response" value="boring"> boring</p>
<p>Comments: <textarea name="comments" rows="3" cols="30" required></textarea></p>
<input type="submit" name="submit" value="Send My Feedback">
</form>
</div>
</body>
</html>
handle_form.php
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Your Feedback</title>
</head>
<body>
<?php // Script 3.3 handle_form.php
// This page receives the data from feedback.html.
// It will receive: title, name, email, response, comments, and submit in $_POST.
// Create shorthand versions of the variables:
$title = $_POST['title'];
$name = $_POST['name'];
$response = $_POST['response'];
$comments = $_POST['comments'];
// Print the received data:
print "<p>Thank you, $title $name, for your comments.</p>
<p>You stated that you found this example to be $response and added:<br>$comments</p>";
?>
</body>
</html>
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.