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

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...
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...
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
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 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...
Create CSS code 4.3. Change/update the CSS to display multiple blocks/courses per line, in a way...
Create CSS code 4.3. Change/update the CSS to display multiple blocks/courses per line, in a way that responds to the width of the browser window and reduces the number of elements per line appropriately. 4.3.1. You may add IDs or classes to the XML file as 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...
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...
Hi, I want to programm a c++ gamr without the using of any array. only by...
Hi, I want to programm a c++ gamr without the using of any array. only by using FUNCTIONS, WHILE LOOPS, FOR LOOPS, IF ELSE, SRADN() and RAND(), BREAK STATEMENT, CIN and COUT. Please help me out.
I want to create an image compression program with matlab use PCA. I have the code...
I want to create an image compression program with matlab use PCA. I have the code listed below. But this code is fail, the image is colorless, but still gray. Can you help me to fix my code. clc clear all picture = im2double(imread('picture1.jpg')); Red = picture(:,:,1); premean = mean(Red(:)); premax = max(Red(:)); premin = min(Red(:)); x = size(Red,1); y = size(Red,2); Z = ones(x,y)*premean; A = (Red - Z)*(1/premax - premin); B = cov(A); [veceig,eig,C] = pcacov(B); NewRed =...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT