Question

Create two web pages as follows: Page 1: An html page with a form that will...

Create two web pages as follows:

Page 1: An html page with a form that will allow the user to enter their name and gender <m/f>

Page 2: A Php document that will process the data from the html form to display a welcome message of either ‘Welcome Mr. <submitted name>’ or ‘Welcome Ms. <submitted name>’

The <submitted name> is what the user submitted in the HTML form.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

welcome.html

<html>
<head>
<title>Welcome Message!! </title>
</head>
<body>
<form action="welcome.php" method="post">

Enter your Name: <input type="text" name="txtName"><br><br>

Gender:
<input type="radio" name="g1" value="Male" id="g1">Male
<input type="radio" name="g1" value="Female" id="g1">Female
<br><br>

<input type="submit" value="Submit" name="result">

</form>
</body>
</html>

welcome.php

<?php
$name=$_POST["txtName"];

if(isset($_POST["result"]))
{
$gender=$_POST["g1"];

if($gender=="Male")
{
echo("Welcome Mr. ".$name);
}
else if($gender=="Female")
{
echo("Welcome Ms. ".$name);
}
}
?>

Output:

Add a comment
Know the answer?
Add Answer to:
Create two web pages as follows: Page 1: An html page with a form that will...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PHP you need to create a form to allow the user to enter their name, email,...

    PHP you need to create a form to allow the user to enter their name, email, and address information. That information will be sent to a PHP script that will process and display that information. Your assignment should have two pages. The first page is straight html (user_input.html) that has a form with the appropriate form elements to collect the user input. The form should then be submitted using the POST method to a php script (display_user_info.php) that will process...

  • Create web pages for your database using PHP. You should have one page that will return...

    Create web pages for your database using PHP. You should have one page that will return all the information from the database. You should create additional pages that will allow you to do various queries of your database. You should be able to retrieve and insert data; also include functionality to delete data from your database. Create an html form that will allow you to enter in new information for the database. The information should be handled by a PHP...

  • implement a program that reads a word and opens one of the following web pages based...

    implement a program that reads a word and opens one of the following web pages based on the word provided: (name it file 1.html) Word                Site Twitter              twitter web site Facebook         Facebook web site yahoo               yahoo web site If the provided word is not part of the above table, your program will open a page called error.html. The error.html page is a page you will define that will display the message "We cannot process your request". Use...

  • i need help with this web page project and i need the code too for this web page Include two or three HTML features that...

    i need help with this web page project and i need the code too for this web page Include two or three HTML features that make the website more robust, dynamic, and professional. Which features you opt to add can be discussed in the discussions. Some ideas might be to have all three types of links (internal to the page, links to your other pages, or links to other websites). Complete a Contact Us page which includes a form. Try...

  • PHP Create an HTML Form that asks for a series of personal information from the user,...

    PHP Create an HTML Form that asks for a series of personal information from the user, and once the user presses the [SUBMIT] button, sends the data to a PHP script that generates HTML code displaying the data entered. The form should have the following fields: First Name (using the text input type) Last Name (using the text input type) E-mail Address (using the email input type) Phone Number (using the tel input type) Date of Birth (using the date...

  • 2- Create Python file to allow the "Digital Library Website" projects to select one of the...

    2- Create Python file to allow the "Digital Library Website" projects to select one of the web pages in the website (A: Books Online, B: Collections, C: Research, Q: Log out or quit). Display message "Please enter your choice: ". When the user selects a choice; it will call a function to process the request and display a message "Welcome to Books Online" as an example for respond if the user selected "A". The user has chance to select another...

  • language:php create a form with textboxes that will allow the user to insert a new product...

    language:php create a form with textboxes that will allow the user to insert a new product name, product price and product code into the database. set the values of category_id, code, name and price that will be inserted. Here, the form will capture the values  Use the correct form method when form data is to be inserted into a database. Display all the available product codes, names and prices in a HTML table directly below the form. That is, when the...

  • In this assignment you will combine HTML, PHP, and SQL in order to create a web...

    In this assignment you will combine HTML, PHP, and SQL in order to create a web form that allows a manager to add films to the sakila database. You will also create a method to allow the manager to view a list of all films along with their related information, and a list of actors in the movies. Task 1 Create an initial HTML page titled manager.html with 2 buttons. The first button will be labeled “View Films”, and the...

  • PHP Programming In this project, you will create a Web page that allows visitors to your...

    PHP Programming In this project, you will create a Web page that allows visitors to your site to sign a guest book that is saved to a database. Create a new document in your text editor and type the <!DOCTYPE> declaration, <html> element, document head, and <body> element. Use the strict DTD and “Guest Book” as the content of the <title> element. Add the following text and elements to the document body: <h2>Enter your name to sign our guest book</h2>...

  • Create a list of several elements you think should make up a login page. Make sure to obtain instructor approval for the...

    Create a list of several elements you think should make up a login page. Make sure to obtain instructor approval for the elements of your login page. Consider the execution flow to capture the user interaction. Execute this assignment according to the following guidelines: 1.In MySQL, build the necessary tables to store the information required during the log in process. 2.In PHP, write the functions that will enable the capturing of user input and store in the database. 3.In HTML,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT