Question

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 following fields:
- Username (text)
- Password (text)
- Submit button

Create another PHP file, "insert-program-item-form.php" with a form that has the following fields:
- User (select)
- Exercise (select)
Each select element should have 3 options. Each option should have a value attribute and the value attribute should be equal to a number (different value for each option).
- Submit button

For each of the preceding forms, submit your values via POST to a PHP processing script that receives your values and outputs them to the web page. So, for example, "insert-user-form.php" should submit to "process-insert-user-form.php" which then outputs the First Name, Last Name, Email and Password that was submitted.

Create another PHP file, "select-users.php".
- Output the string: "Users" on this page.
- If a GET variable, "userid" is passed to this script via the url, output the string: "User" followed by the value of the GET variable. Your script must handle this logic.
Remember, you are in control of the URL so you can test whether or not you show "Users" or "User" followed by the value of the GET variable.

WANTED PHP CODE

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

insert-user-form.php

<!DOCTYPE html>

<html>

    <head>

        <meta charset="UTF-8">

        <title>title</title>

    </head>

    <body>

        <form action='process-insert-user-form.php' method='POST'>

            First Name <br><input type='text' name='fname'>

            <br>Last Name <br><input type='text' name='lname'>    

            <br>Email <br> <input type='text' name='email'>      

            <br>Password <br> <input type='password' name='password'>

            <br><input type='submit' name='submit'>

        </form>

    </body>

</html>

insert-exercise-form.php

<!DOCTYPE html>

<html>

    <head>

        <meta charset="UTF-8">

        <title>title</title>

    </head>

    <body>

        <form action='process-insert-exercise-form.php' method='POST'>

            Exercise Name <br><input type='text' name='exercise'>

            <br>Description <br><input type='text' name='desc'>   

            <br>Demonstration Image <input type='file' name='demo'>     

            <br><input type='submit' name='submit'>

        </form>

    </body>

</html>

insert-program-item-form.php

<!DOCTYPE html>

<html>

    <head>

        <meta charset="UTF-8">

        <title>title</title>

    </head>

    <body>

        <form action='process-insert-program-item-form.php' method='POST'>

        User <select name="User">

            <option value="1">1</option><br>

                <option value="2">2</option>

                <option value="3">3</option>

            </select>

        <br>   

        Exercise <select name="Exercise">

                <option value="4">4</option><br>

                <option value="5">5</option>

                <option value="6">6</option>

            </select>

            <br><input type='submit' name='submit'>

        </form>

    </body>

</html>

login-user-form.php

<!DOCTYPE html>

<html>

    <head>

        <meta charset="UTF-8">

        <title>title</title>

    </head>

    <body>

        <form action='process-login-user-form.php' method='POST'>

            Username <br><input type='text' name='username'>      

            <br>Password <br> <input type='password' name='password'>

            <br><input type='submit' name='submit'>

        </form>

    </body>

</html>

process-insert-exercise-form.php

<?php

//check if submit button was pressed before processing the data

    if(isset($_POST['submit'])){

//display the received data from the POST request

        echo "Exercise Name: ". $_POST['exercise'];

        echo "<br>Description: ". $_POST['desc'];

        echo "<br>Demonstration Image: ". $_POST['demo'];

    }

?>

process-insert-program-item-form.php

<?php

//check if submit button was pressed before processing the data

    if(isset($_POST['submit'])){

//display the received data from the POST request

        echo "User: ". $_POST['User'];

        echo "<br>Exercise: ". $_POST['Exercise'];

    }

?>

process-insert-user-form.php

<?php

//check if submit button was pressed before processing the data

    if(isset($_POST['submit'])){

//display the received data from the POST request

        echo "First Name: ". $_POST['fname'];

        echo "<br>Last Name: ". $_POST['lname'];

        echo "<br>Email: ". $_POST['email'];

        echo "<br>Password: ". $_POST['password'];

    }

?>

process-login-user-form.php

<?php

//check if submit button was pressed before processing the data

    if(isset($_POST['submit'])){

//display the received data from the POST request

        echo "Username: ". $_POST['username'];

        echo "<br>Password: ". $_POST['password'];

    }

?>

select-users.php

<?php

//check if the get request contains userid

    if(isset($_GET['userid'])){

//display the received data from the GET request

        echo "User: " . $_GET['userid'];

    }

?>

Add a comment
Know the answer?
Add Answer to:
Create a folder named "TrainerApp". In that folder create the following files. Create a PHP file,...
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 code that is given : <?php // Here is where your preprocessing code goes //...

    PHP code that is given : <?php // Here is where your preprocessing code goes // An example is already given to you for the First Name $fname = $_GET['fname']; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Exercise 2 - GET Echo</title> <style> body { margin:0; padding:0; font-family: Arial; } form { margin:20px; } input[type="text"], input[type="password"] { width:150px; padding:3px; font-size:1em; } input[type="submit"] { padding:3px; font-size:1em; } label { display:inline-block; width:150px; } .input-container { padding:5px; } </style> </head> <body> <form...

  • 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...

  • How can I print the Database table in PHP please ? here I have form for name and email, also I have php code that allow...

    How can I print the Database table in PHP please ? here I have form for name and email, also I have php code that allow user to add his name and email to my database, all I need to print my final database when the user click on submit. <form action="" method="post"> <label>Name :</label> <input type="text" name="name" required="required" placeholder="Please Enter Name"/><br /><br /> <label>Email :</label> <input type="email" name="email" required="required" /><br/><br /> <input type="submit" value=" Submit " name="submit"/><br /> </form>...

  • 1. Write the php statements to connect to MySQL server and select the database named personnel....

    1. Write the php statements to connect to MySQL server and select the database named personnel. The database personnel is located at localhost server. The user id and password to log on to the server are finalexam and thePassword respectively. 2. Using the above connection, write the php statements to retrieve the name and the email fields from all records of the users table ( 'SELECT name, email FROM users') and display them one record per line.

  • 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...

  • given below are the project description and their Html and css files i need javascript according to the project and other files!

    HTML------------------------------------------------------CSS---------------------------------------------------WEB230 - JavaScript 1 Assignment 7 - FormsSome of these tasks would be better done in HTML or CSS but do them in JavaScript to practice whatwe have learned.1. Select the form element and save it in a variable. From here we can access all of the form fields.2. When the page loads do the following:add the password value "monkey"select the favourite city "New York"clear the textarea3. Add an event handler to the "name" field to change the background color...

  • 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:...

  • You need to implement a web application that is split in three parts, namely, Webpage, PHP and My...

    You need to implement a web application that is split in three parts, namely, Webpage, PHP and MySQL. Each of them will be used accordingly to solve a simple problem described below. Remember to implement the logic in the most secure way of your knowledge. PHP Implement a PHP function that reads in input a string from the user and store it in a table (e.g., in a field called "Content Name"). The function should be able to read the...

  • 8. Write a script that creates an associative or multidimensional array in PHP a. And displays that array in a table b. Create a form with at least two input fields and a Submit button. c. Write a scr...

    8. Write a script that creates an associative or multidimensional array in PHP a. And displays that array in a table b. Create a form with at least two input fields and a Submit button. c. Write a script that will validate that the user entered data in the input fields and that the fields are not blank when the Submit button is pressed d. And returns the values entered in the input field when the Submit button is pressed.

  • 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>...

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