Consider the following XHTML form: In the form below please write what kind of a
ID: 3843635 • Letter: C
Question
Consider the following XHTML form: In the form below please write what kind of animals your pets are and their names Then click submit. Animal Name Animal Name When the user clicks submit, a PHP program form.php is called. The script takes the information supplied by the user and writes it into a table form. For example, filling the form as below: In the form below please write what kind of animals your pets are and their names. Then click submit. should result in the following XHTML page being sent to the user: Write the PHP code snippet to process the form data and to create the XHTML table. You need not have the PHP write any other XHTML than what is required for the table.Explanation / Answer
Copy the below code into php and save it as form.php and refer it in the html page.It will display The above reult.
<?php
echo "<table>";
echo "<tr><td>".$_GET["animal1"]."</td>";
echo "<td>".$_GET["name1"]."</td></tr>";
echo "<tr><td>".$_GET["animal2"]."</td>";
echo "<td>".$_GET["name2"]."</td></tr>";
echo "</table>";
?>
Let me know if you have any queries. Thanks,
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.