Question

In: Computer Science

I want the code in the following three PHP files without any CSS. Thank you Create...

I want the code in the following three PHP files without any CSS. Thank you

Create a Input.php.

Create a PHP script that will perform the following tasks:

1. Divide the content area of this page into two sections (Side by Side)

2. On the left side: create a form that accepts the following information from the user

a. Text box, Employee Name

b. Text box, Employee ID

c. Text box, Telephone Number

d. Text box, Email Address

e. Radio Button List, with the values Manager, Team Lead, IT Developer, and IT Analyst

f. Select, a multiple select box that lists 4 IT projects: Project A, Project B, Project C, Project D

g. Submit button with the text ‘Submit Information’

3. On the right side: When the user clicks 'Submit Information' gather all the information from the form on the left side and display the results on the right side

Create a Session1.php

Create a PHP script that will perform the following tasks:

1. Implement the same form listed in Input.php, Part 2

2. This time, when the user clicks 'Submit Information' , store all the information gathered from the form in the Session State

3. Automatically Redirect the user to Session2.php

Create a Session2.php

Once the user is forwarded to Session2.php, display the results of the information gathered in the form on Session2.php

NOTE: Forms, Session_RetrieveValues.php, Session_StoreValues.php provide examples of how to do all of these things.

Solutions

Expert Solution

Part 1 :

CODE :

input.php

<!DOCTYPE HTML>

<html>

<head>

<style>

.column {

text-align:center;

float: left;

width: 50%;

}

/* Clear floats after the columns */

.row:after {

content: "";

display: table;

clear: both;

}

</style>

</head>

<body>

<?php

// define variables and set to empty values

$employeeName = $email = $post = $employeeID = $phone = $project = "";

if ($_SERVER["REQUEST_METHOD"] == "POST") {

$employeeName=test_input($_POST["employeeName"]);

$employeeID = test_input($_POST["employeeID"]);

$email = test_input($_POST["email"]);

$phone = test_input($_POST["phone"]);

$post = test_input($_POST["post"]);

$project=test_input($_POST['project']);

}

function test_input($data) {

$data = trim($data);

$data = stripslashes($data);

$data = htmlspecialchars($data);

return $data;

}

?>

<div class="row">

<div class="column">

<h2>PHP </h2>

<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">

Employee Name: <input type="text" name="employeeName" value="<?php echo $employeeName;?>">

<br><br>

Employee ID: <input type="text" name="employeeID" value="<?php echo $employeeID;?>">

<br><br>

Telephone Number: <input type="text" name="phone" value="<?php echo $phone;?>">

<br><br>

E-mail: <input type="text" name="email" value="<?php echo $email;?>">

<br><br>

Post:

<input type="radio" name="post" <?php if (isset($post) && $post=="Manager") echo "checked";?> value="manager">Manager

<input type="radio" name="post" <?php if (isset($post) && $post=="TeamLead") echo "checked";?> value="Team Lead">Team Lead

<input type="radio" name="post" <?php if (isset($post) && $post=="itDeveloper") echo "checked";?> value="IT Developer">IT Developer

<input type="radio" name="post" <?php if (isset($post) && $post=="itAnalyst") echo "checked";?> value="IT Analyst">IT Analyst

<br><br>

<label for="project">Choose a project: </label>

<select name="project" id="project">

<option value="Poject A">Project A</option>

<option value="Project B">Project B</option>

<option value="Project C">Project C</option>

<option value="Project D">Project D</option>

</select>

<br><br>

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

</form>

</div>

<div class="column">

<?php

echo "<h2>Submitted Information</h2>";

echo "<label>Employee Name : </label>";

echo $employeeName;

echo "<br>";

echo "<label>Employee ID : </label>";

echo $employeeID;

echo "<br>";

echo "<label>Telephone Number : </label>";

echo $phone;

echo "<br>";

echo "<label>Email Address: </label>";

echo $email;

echo "<br>";

echo "<label>Post : </label>";

echo $post;

echo "<br>";

echo "<label>Project : </label>";

echo $project;

?>

</div>

</div>

</body>

</html>

SCREENSHOT :

OUTPUT :

Part 2 :

Session1.php

CODE :

<!DOCTYPE HTML>

<html>

<head>

<style>

</style>

</head>

<body>

<?php


// define variables and set to empty values

$employeeName = $email = $post = $employeeID = $phone = $project = "";

if ($_SERVER["REQUEST_METHOD"] == "POST") {

session_start();

$employeeName=test_input($_POST["employeeName"]);

$employeeID = test_input($_POST["employeeID"]);

$email = test_input($_POST["email"]);

$phone = test_input($_POST["phone"]);

$post = test_input($_POST["post"]);

$project=test_input($_POST['project']);

$_SESSION['employeeName']=$employeeName;

$_SESSION['employeeID']=$employeeID;

$_SESSION['email']=$email;

$_SESSION['phone']=$phone;

$_SESSION['post']=$post;

$_SESSION['project']=$project;

?>
<script type="text/javascript">
   window.location="session2.php";
</script>
<?php

exit();
}

function test_input($data) {

$data = trim($data);

$data = stripslashes($data);

$data = htmlspecialchars($data);

return $data;

}
?>

<h2>PHP </h2>

<form method="post">

Employee Name: <input type="text" name="employeeName" value="<?php echo $employeeName;?>">

<br><br>

Employee ID: <input type="text" name="employeeID" value="<?php echo $employeeID;?>">

<br><br>

Telephone Number: <input type="text" name="phone" value="<?php echo $phone;?>">

<br><br>

E-mail: <input type="text" name="email" value="<?php echo $email;?>">

<br><br>

Post:

<input type="radio" name="post" <?php if (isset($post) && $post=="Manager") echo "checked";?> value="manager">Manager

<input type="radio" name="post" <?php if (isset($post) && $post=="TeamLead") echo "checked";?> value="Team Lead">Team Lead

<input type="radio" name="post" <?php if (isset($post) && $post=="itDeveloper") echo "checked";?> value="IT Developer">IT Developer

<input type="radio" name="post" <?php if (isset($post) && $post=="itAnalyst") echo "checked";?> value="IT Analyst">IT Analyst

<br><br>

<label for="project">Choose a project: </label>

<select name="project" id="project">

<option value="Poject A">Project A</option>

<option value="Project B">Project B</option>

<option value="Project C">Project C</option>

<option value="Project D">Project D</option>

</select>

<br><br>

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

</form>

</body>

</html>

Session2.php

CODE :

<!DOCTYPE HTML>

<html>

<head>

<style>

</style>

</head>

<body>

<?php


// define variables and set to empty values

$employeeName = $email = $post = $employeeID = $phone = $project = "";

session_start();

$employeeName=$_SESSION['employeeName'];

$employeeID = $_SESSION['employeeID'];

$email = $_SESSION['email'];

$phone = $_SESSION['phone'];

$post = $_SESSION['post'];

$project=$_SESSION['project'];

echo "<h2>Submitted Information</h2>";

echo "<label>Employee Name : </label>";

echo $employeeName;

echo "<br>";

echo "<label>Employee ID : </label>";

echo $employeeID;

echo "<br>";

echo "<label>Telephone Number : </label>";

echo $phone;

echo "<br>";

echo "<label>Email Address: </label>";

echo $email;

echo "<br>";

echo "<label>Post : </label>";

echo $post;

echo "<br>";

echo "<label>Project : </label>";

echo $project;


?>

</body>

</html>

SCREENSHOT CODE :

session1.php

session2.php

OUTPUT :

Please provide feedback and comment down if any problem persists.


Related Solutions

So pretty much I need my code without the arrays, or lists. Please and thank you!...
So pretty much I need my code without the arrays, or lists. Please and thank you! Important: You may not use arrays, lists, or similar for your questions. This will be covered in the next module. The objective is to use conditionals in order to achieve the overall task. Checkpoint 3 is a continuation of the “Quiz” Programming Project. This module week, you will implement repetitive tasks in your program while using conditional and iteration statements in C#. Implement a...
can you please create the code program in PYTHON for me. i want to create array...
can you please create the code program in PYTHON for me. i want to create array matrix Nx1 (N is multiple of 4 and start from 16), and matrix has the value of elements like this: if N = 16, matrix is [ 4 4 4 4 -4 -4 -4 -4 4 4 4 4 -4 -4 -4 -4] if N = 64, matrix is [8 8 8 8 8 8 8 8 -8 -8 -8 -8 -8 -8 -8...
I just want the code blanking led for PIC microprocessor in MBLAB X Thank you
I just want the code blanking led for PIC microprocessor in MBLAB X Thank you
How can I make my php code without using the money format just loop and if...
How can I make my php code without using the money format just loop and if statements print like this: Change for 5 dollars and 20 cents: 0 ten dollar bills 1 five dollar bills 0 one dollar bills 0 quarters 2 dime 0 nickel 0 pennies I am trying to ask the user to enter amount and output their change they entered. $input; $TenBills = 1000; $FiveBills = 500; $OneBills = 100; $Quarters = 25; $Dimes = 10; $Nickels...
5 html files minimum (does not include css file) Use of all three methods of css...
5 html files minimum (does not include css file) Use of all three methods of css (inline, internal, external). Have inline and internal css on all 5 html files and use one external css file that styles all 5 html pages Use div tags to section off part of the pages and add border radius the divs 1 paragraph on at least 5 html pages (1 paragraph must have at least 6 sentences) The following CSS properties must be used...
write php code for buying and selling web using sql, javascript ,html ,css style
write php code for buying and selling web using sql, javascript ,html ,css style
How would I structure the following PHP (PDO) code into a table format using only PHP?...
How would I structure the following PHP (PDO) code into a table format using only PHP? //Our SQL statement, which will select a list of tables from the current MySQL database. $sql = "SELECT * FROM jobs"; //Prepare our SQL statement, $statement = $pdo->prepare($sql); //Execute the statement. $statement->execute(); //Fetch the rows from our statement. $tables = $statement->fetchAll(PDO::FETCH_NUM); //Loop through our table names. foreach($tables as $table){ //Print the table name out onto the page. echo $table[0], ' '; echo $table[1], '...
Create CSS styling for this xml code 5.2. Change the CSS so only a single course...
Create CSS styling for this xml code 5.2. Change the CSS so only a single course is displayed. 5.2.1. You may add IDs or classes to the XML file a desired. <InformationSystems>    <Classes>        <CourseHeader>            <CourseNumber>CIS 145</CourseNumber>            <CourseName>Introduction to Relational Database</CourseName>            <Credits>5</Credits>        </CourseHeader>        <Description><![CDATA[Introduces relational database concepts and practices using business-related examples. OFTEC 111 or 108 recommended, or comparable competencies. Prerequisite: OFTEC 141 or MATH...
PHP Language I have XAMPP and I don't know how to display my PHP code. For...
PHP Language I have XAMPP and I don't know how to display my PHP code. For instance, when I create a basic HTML webpage I just open the code into a web browser and it shows me a basic web page. When I try to show a PHP calculation it doesn't show. What are the steps in displaying my PHP doc?
Question1 (50 pts): LU Factorization Code for Square Matrices without Row Exchange I want you to...
Question1 (50 pts): LU Factorization Code for Square Matrices without Row Exchange I want you to write an LU decomposition program in Matlab for square matrices (n×n) where row exchange is not necessary (that is no pivot is 0). Here are some hints and requirements for your matlab code. You should write comments for every procedure. Make sure that your code is well indexed (see below). Otherwise it will be hard for me to follow and bad programming practice for...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT