Objective Create a form with HTML and use PHP to display the output Methods: In
ID: 3709386 • Letter: O
Question
Objective Create a form with HTML and use PHP to display the output Methods: In your project group, create a form which allows a user to enter their information and create an account. At this time, this account will not be functional; you will learn those skills later in the course. The task is to simply ask the user for several different types of input via an online form and to repeat that information back to the user Use the $_GET method along with the form information provided in this week's essay To get full credit you will need to use several types of inputs and display the user's information in a clear, logical manner Submission Requirements: Submit this assignment as a team in the group dropbox. You should have two files: the form in which the user inputs information and a page which displays the information. In addition to the dropbox files, please provide a link to one of the team members' page:s where these two pages are functional Simplified Example Input Page Output Page Desired Usmewannabek8 First Nane. Kate Last Name: Welcome Kate! IHere is the information you submitted. Name Kate Lindaman aman Where did vou hear about our site? Friend Facebook Radio Advertisement Other Whete did you hear about our site? X Friend X Facebook Radio Advertisement Are you interested d in receiving promotional materials? receiving Are you interested ? ?ecening protnotional matenals? Yes O No Submit Notice how the information is displayed logicallyExplanation / Answer
The HTML code for the input page is given below: -
input.html
<html>
<head>
<title>FORM</title>
</head>
<body>
<font size="10"><u>SIGN UP!</u></font>
<form name="f1" method="post" action="output.php">
<br>
<br>
<font size="5">Desired Username:-</font> <input type="text" name="t1">
<br>
<br>
<font size="5">First Name:-</font> <input type="text" name="fname">
<br>
<br>
<font size="5">Last Name:-</font> <input type="text" name="lname" >
<br>
<br>
<font size="5">Where did your hear about our site?</font>
<br>
<br>
<input type="checkbox" name="c1" value="on">Friend
<br>
<input type="checkbox" name="c2" value="on">Facebook
<br>
<input type="checkbox" name="c3" value="on">Radio Advertisement
<br>
<input type="checkbox" name="c4" value="on">Other
<br>
<br>
<font size="5">Are you interested in receiving promotional materials:-</font>
<br>
<br>
<input type="radio" name="promo" value="Yes">Yes
<br>
<input type="radio" name="promo" value="No">No
<br>
<br>
<input type="submit" value="Submit ">
</form>
</body>
</html>
when you will enter the details in the form and hit the submit button you will be directed to output.php page and will give you your information and for that the code is given below: -
output.php
<html>
<head>
<title>view information</title>
</head>
<body>
<font size="5" ><b>Welcome <?php echo $_POST['fname']; ?>!</b></font>
<br>
<br>
<font size="5" ><b>Here is the information you submitted.</b></font>
<br>
<br>
<font size="5">Name: <b><?php echo $_POST['fname']; ?><? php echo $_POST['lname']; ?></b></font>
<br>
<font size="5" >Username: <b><?php echo $_POST['uname']; ?></b></font>
<br>
<br>
<font size="5" >Where did you hear about our site?</font>
<br>
<font size="5" ><?php
if(isset($_POST['submit'])){
foreach($_POST['check'] as $check)
{
echo $check." ";
}
}
?></font>
<br>
<br>
<font size="5" >Are you interested in receiving promotional materials?</font>
<br>
<font size="5"><?php if (isset($_POST['promo']) && ($_POST['promo']=="Yes"))
{ echo checked;
echo $_POST['promo'];
}
?>
</font>
<font size="5"><?php if (isset($_POST['promo']) && ($_POST['promo']=="No"))
{ echo checked;
echo $_POST['promo'];
}
?>
</font>
</body>
</html>
This will give the desired information logically in an web page.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.