PHP***** Ex-1 Create a feedback form which contains a drop down list, three text
ID: 3711871 • Letter: P
Question
PHP*****
Ex-1 Create a feedback form which contains a drop down list, three text fields, a radio button group, a comment field, and a submit button. When user click the submit button, your system will echo back whatever user entered. Please complete this form to submit your feedback Name: Dr. Dr. Email Mr. Mrs. Phone 1 Ms. Rating... O excellent okay boring Please complete this form to submit your feedback: Name: Mr. Comments: Email Address: ! Please fill out this field. Send My Feedback Please complete this form to submit your feedback: | Please complete this form to submit your feedback Name: Mr. Johnson Name: Mr. Johnson Email Address: Email Address: js@gmail.com Phone Number: : Please fill out this field. Phone Number: Rating... O excellent okay boring Rating... excellent . Please fill out this field. Comments: Comments: Send My Feedback Send My Feedback Please complete this form to submit your feedback: Name: Mr. Johnson Email Address: js@gmail.com Phone Number: 123-456-7890 Rating... excellent okay boring I like it Comments:Explanation / Answer
Following is the answer:
<?php
if(isset($_POST['submit'])){
$name = $_POST['name'];
$opt = $_POST['opt'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$rating = $_POST['rating'];
$comment = $_POST['comment'];
echo "<br>"."Name: ".$opt." ".$name."<br>";
echo "Email Address: ".$email."<br>";
echo "Phone Number: ".$phone."<br>";
echo "Rating: ".$rating."<br>";
echo "Comment: ".$comment."<br>"."<br>"."<br>";
}
?>
<html>
<body>
<form method="post">
<table>
<tr>
<td>Name:
<select name="opt">
<option>Dr.</option>
<option>Mr.</option>
<option>Mrs.</option>
<option>Ms.</option>
</select>
</td>
<td>
<input type="text" name="name" required />
</td>
</tr>
<tr>
<td>Email Address:</td>
<td>
<input type="email" name="email" required />
</td>
</tr>
<tr>
<td>Phone Number:</td>
<td><input type="text" name="phone" required /></td>
</tr>
<tr>
<td>Rating...
</td>
<td>
<input type="radio" name="rating" value="excellent" required />excellent
<input type="radio" name="rating" value="okay" required />okay
<input type="radio" name="rating" value="boring" required />boring
</td>
</tr>
<tr>
<td>Comments:</td>
<td>
<textarea cols="19" rows="7" name="comment"> </textarea>
</td>
</tr>
<tr>
<td>
<input type="submit" name="submit" value="Send My Feedback" />
</td>
</tr>
</table>
</form>
</body>
</html>
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.