Question

Purpose: Experiment the interactive mode with php Instruction: Implement the following  two different  requirements and compare the results:...

Purpose: Experiment the interactive mode with php

Instruction: Implement the following  two different  requirements and compare the results:

Implementation 1: Create a html file (login.html) with a login form that contains two labels, two text boxes and one submit button as follows:

User Name: ______________

Password: _______________

submit

When a user enters values for user name and password text boxes and clicks the submit button, the values are sent to login_handle.php and the values are assigned to two variables: $username and $password. Then, the scripts respond to the user a welcome message with the user name. For example, if a user enters "Peter" as the user name and the password, then the script responds to the user "Welcome Peter!"

Implementation 2: Create a user.html file with a user form as follows:

User Name: ______________

    submit

When a user enters  a value for the user name text box and clicks the submit button,  the value is sent to user_handle.php and assigned to a variable: $username. Then, the script responds to the user with a form with one label and one text box as follows:

Password: ______________

    submit

When a user enters a value for the password text box and clicks the submit button,  the value is sent to password_handle.php and the password value is assigned to a variable: $password.   Then, the scripts respond to the user a welcome message with the user name.  For example, if a user enters "Peter" as the user name in the user.html then the script shall respond to the user "Welcome Peter!"

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

1. login.html


<!DOCTYPE HTML>
<html>
<body>

<form action="login_handle.php" method="post">
UserName: <input type="text" name="username"><br>
Password: <input type="password" name="password"><br>
<input type="submit">
</form>

</body>
</html>

login_handle.php

<html>
<body>

Welcome <?php echo $_POST["username"]; ?>

</body>
</html>

2.

user.html


<!DOCTYPE HTML>
<html>
<body>

<form action="user_handle.php" method="post">
UserName: <input type="text" name="name"><br>
<input type="submit">
</form>

</body>
</html>


user_handle.php


<!DOCTYPE HTML>
<html>
<body>

<form action="password_handle.php?username=<?php echo $_POST['username'] ?>" method="post">
Password: <input type="password" name="password"><br>
<input type="submit">
</form>

</body>
</html>

password_handle.php

<html>
<body>

Welcome <?php echo $_GET["username"]; ?>

</body>
</html>

Add a comment
Know the answer?
Add Answer to:
Purpose: Experiment the interactive mode with php Instruction: Implement the following  two different  requirements and compare the results:...
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
  • Create a folder named "TrainerApp". In that folder create the following files. Create a PHP file,...

    Create a folder named "TrainerApp". In that folder create the following files. Create a PHP file, "insert-user-form.php", with a form that has the following fields: - First Name (text) - Last Name (text) - Email (text) - Password (text) - Submit button Create another PHP file, "insert-exercise-form.php" with a form that has the following fields: - Exercise Name (text) - Description (text) - Demonstration Image (file) - Submit button Create another PHP file, "login-user-form.php" with a form that has the...

  • LANGUAGE JAVASCRIPT, PHP Need help with PHP and ajax code. The user needs to login but,...

    LANGUAGE JAVASCRIPT, PHP Need help with PHP and ajax code. The user needs to login but, I keep getting an error that I coded "Wrong username and password!" ***PLEASE DONT GIVE ME A NEW CODE THAT IS NOWHERE NEAR THE CODE I SUBMITTED***** PLEASE LOOK AT THE CODE AND SEE ANY ISSUES login.html <!DOCTYPE html> <html> <head> <title>login popup</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <style type="text/css"> body { background-color: white; } </style> </head> <body> <center> <h1 style="text-align: center;"> Login </h1> <form>             Login ID:...

  • Modify the following file, so that: If the user input for the age input box is...

    Modify the following file, so that: If the user input for the age input box is empty, please send the user a warning message: “Age field cannot be empty” and return to the form web page to allow the user to re-input the age; If the user input for the age input box is incorrect (e. g. less than 1), please also send the user a warning message: “Your age input is not correct!” and return to the form web...

  • NEED HELP with HTML with Javascript embedding for form validation project below. I have my code...

    NEED HELP with HTML with Javascript embedding for form validation project below. I have my code below but I'm stuck with validation. If anyone can fix it, I'd really appreciate. ****************************************************************************** CODE: <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>Nice</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> var textFromTextArea; function getWords(){ var text =...

  • Create an HTML5 page that contains a form to collect the following data. The text in...

    Create an HTML5 page that contains a form to collect the following data. The text in bold indicates the id value that should be assigned to each html control: Product (drop down list) product – iPad, iPhone 6S, Galaxy 5S, Moto X, and so on Quantity (number) quantity Unit price (number) unit_price Discount (%)(number) discount_rate Date (date)   order_date First Name (text box)   first_name Last Name (text box)   last_name Payment type (drop down list)   payment_type – Visa, Master, Discover, Amex, and...

  • Write a PHP script that obtains a URL and its description from user and stores the...

    Write a PHP script that obtains a URL and its description from user and stores the information into a database using MySQL. Create and run a SQL script with database named URL and a table named Urltable. The first field of the table should contain an actual URL, and the second, which is named Description, should contain a description of the URL. Use www.deitel.com as the first URL, and input Cool site! as its description. The second URL should be...

  • C# Temp. Converter program. Create a Celsius and Fahrenheit Temperature Converter application. The application must have...

    C# Temp. Converter program. Create a Celsius and Fahrenheit Temperature Converter application. The application must have 2 Labels (each one of them assigned only to Celsius and Fahrenheit), 2 TextBoxes (each one of them assigned only to Celsius and Fahrenheit), only 1 Convert Button, 1 Clear Button, and 1 Exit Button. Also, 1 Error message label which will display the error messages. The application should only allow the user to enter the desired temperature just in one of the TextBoxes...

  • The first script is validate.sh. This is a simple form validation script that will be used...

    The first script is validate.sh. This is a simple form validation script that will be used to verify the inputs given. Normally, this would be done to validate input from a website or another program before entry into a database or other record storage. In this case, we will keep it simple and only focus on the input validation step. In particular, the script should prompt the user for four values: first name, last name, zip code, and email address....

  • I need help writting a Javascript function that does the following its for a HTML/CSS Shopping...

    I need help writting a Javascript function that does the following its for a HTML/CSS Shopping Cart Page CODE This page contains a list of the selected products that includes an image, name, price, quantity, and cost) Because the process is implemented not as real, three products along with its image and price are displayed on the page. The product ID of each product is stored in a hidden textbox. The default amount of each product is 1 and the...

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