In: Computer Science
Please create a PHP action codes for the HTML CODE provided below.
<!DOCTYPE html>
<html>
<head>
<title>
Project for keeping all your input
</title>
</head>
<body>
<h1>Welcome to this Web Based Test!!!</h1>
<p>Please answer the following questions:</p>
<hr/>
<form action="" method="post">
Name: <input type="text" name="name" value=""> <font color=red>*</font><br/><br/>
E-mail: <input type="text" name="email" value=""> <font color=red>*</font><br>
<hr/>
Choose your major area of study: <select name="major">
<option value="Digital Media" >Digital Media</option>
<option value="Software" >Software</option>
<option value="Security" >Security</option>
<option value="Business" >Business</option>
<option value="Other" >Other</option>
</select> <br/>
<hr/>
<p>Questons 1 (25points)</p>
<p>If my name is Will Smith, what is my first name?</p>
<input type="radio" value="A" name="Q1" >A. Will <br/>
<input type="radio" value="B" name="Q1" >B. Smith<br/>
<input type="radio" value="C" name="Q1" >C. Will Smith<br/>
<input type="radio" value="D" name="Q1" >D. Smith Will<br/>
<hr/>
<p>Questons 2 (25points)</p>
<p>If my favoriate color is red, what color I like most?</p>
<input type="radio" value="A" name="Q2" >A. blue<br/>
<input type="radio" value="B" name="Q2" >B. pink<br/>
<input type="radio" value="C" name="Q2" >C. red <br/>
<input type="radio" value="D" name="Q2" >D. black<br/>
<hr/>
<p>Questons 3 (25points)</p>
<p>If I was born and grew up in New York, what is my hometown's name?</p>
<input type="radio" value="A" name="Q3" >A. LA<br/>
<input type="radio" value="B" name="Q3" >B. Las Vegas<br/>
<input type="radio" value="C" name="Q3" >C. Detroit<br/>
<input type="radio" value="D" name="Q3" >D. New York <br/>
<hr/>
<p>Questons 4 (25points)</p>
<p>If my birthday is 10/27/1998, what is 10+27?</p>
<input type="radio" value="A" name="Q4" >A. 27<br/>
<input type="radio" value="B" name="Q4" >B. 37 <br/>
<input type="radio" value="C" name="Q4" >C. 17<br/>
<input type="radio" value="D" name="Q4" >D. 47<br/>
<hr/>
<input type="checkbox" name="showanswer" value="YES" > Show correct answers after submission.
<br/><br/>
<input type="submit" value="Submit this test" name="submit">
<input type="submit" name="reset" value="Reset">
</form>
<!--for admin -->
<hr/>
<div style="text-align:left;background-color:pink;width:50%;margin:auto;">
<form action="action-project-1.2.php" method="post">
<div style="text-align:right;margin-right: 20%;">
Admistrator ID: <input type="text" name="name"> <font color=red>*</font><br>
Password: <input type="password" name="passwd"> <font color=red>*</font><br>
</div>
<hr/>
<div style="text-align:left;margin-left: 20%;">
<input type="radio" name="showwhat" value="all">Show all grades<br/>
<input type="radio" name="showwhat" value="sorted">Show all grades sorted descendly <br/>
<input type="radio" name="showwhat" value="p100">Show all grades that are 100<br/>
<input type="radio" name="showwhat" value="dm0">Show all grades that are 0 and are of Digital Media Major <br/>
<input type="radio" name="showwhat" value="byname">Find student(s)'s grade by name: <input type="text" name="student" value=""><br/>
</div>
<hr/>
<div style="text-align:center;">
<input type="submit" value="See grades" name="submitme"><input type="reset">
</div>
</form>
</div>
<hr/>
</body>
</html>
hey here i am done ! here is the code ---
Please give me a like for appreciate my work --
<!DOCTYPE html>
<html>
<head>
<title>
Project for keeping all your input
</title>
</head>
<body>
<h1>Welcome to this Web Based Test!!!</h1>
<p>Please answer the following questions:</p>
<hr/>
<form action="MainHtml.php" method="post">
Name: <input type="text" name="name" value=""> <font color=red>*</font><br/><br/>
E-mail: <input type="text" name="email" value=""> <font color=red>*</font><br>
<hr/>
Choose your major area of study: <select name="major">
<option value="Digital Media" >Digital Media</option>
<option value="Software" >Software</option>
<option value="Security" >Security</option>
<option value="Business" >Business</option>
<option value="Other" >Other</option>
</select> <br/>
<hr/>
<p>Questons 1 (25points)</p>
<p>If my name is Will Smith, what is my first name?</p>
<input type="radio" value="A" name="Q1" >A. Will <br/>
<input type="radio" value="B" name="Q1" >B. Smith<br/>
<input type="radio" value="C" name="Q1" >C. Will Smith<br/>
<input type="radio" value="D" name="Q1" >D. Smith Will<br/>
<hr/>
<p>Questons 2 (25points)</p>
<p>If my favoriate color is red, what color I like most?</p>
<input type="radio" value="A" name="Q2" >A. blue<br/>
<input type="radio" value="B" name="Q2" >B. pink<br/>
<input type="radio" value="C" name="Q2" >C. red <br/>
<input type="radio" value="D" name="Q2" >D. black<br/>
<hr/>
<p>Questons 3 (25points)</p>
<p>If I was born and grew up in New York, what is my hometown's name?</p>
<input type="radio" value="A" name="Q3" >A. LA<br/>
<input type="radio" value="B" name="Q3" >B. Las Vegas<br/>
<input type="radio" value="C" name="Q3" >C. Detroit<br/>
<input type="radio" value="D" name="Q3" >D. New York <br/>
<hr/>
<p>Questons 4 (25points)</p>
<p>If my birthday is 10/27/1998, what is 10+27?</p>
<input type="radio" value="A" name="Q4" >A. 27<br/>
<input type="radio" value="B" name="Q4" >B. 37 <br/>
<input type="radio" value="C" name="Q4" >C. 17<br/>
<input type="radio" value="D" name="Q4" >D. 47<br/>
<hr/>
<input type="checkbox" name="showanswer" value="YES" > Show correct answers after submission.
<br/><br/>
<input type="submit" value="Submit this test" name="submit">
<input type="submit" name="reset" value="Reset">
</form>
<!--for admin -->
<hr/>
<div style="text-align:left;background-color:pink;width:50%;margin:auto;">
<form action="action-project-1.2.php" method="post">
<div style="text-align:right;margin-right: 20%;">
Admistrator ID: <input type="text" name="name"> <font color=red>*</font><br>
Password: <input type="password" name="passwd"> <font color=red>*</font><br>
</div>
<hr/>
<div style="text-align:left;margin-left: 20%;">
<input type="radio" name="showwhat" value="all">Show all grades<br/>
<input type="radio" name="showwhat" value="sorted">Show all grades sorted descendly <br/>
<input type="radio" name="showwhat" value="p100">Show all grades that are 100<br/>
<input type="radio" name="showwhat" value="dm0">Show all grades that are 0 and are of Digital Media Major <br/>
<input type="radio" name="showwhat" value="byname">Find student(s)'s grade by name: <input type="text" name="student" value=""><br/>
</div>
<hr/>
<div style="text-align:center;">
<input type="submit" value="See grades" name="submitme"><input type="reset">
</div>
</form>
</div>
<hr/>
</body>
</html>
and MainHtml.php
<html>
<body>
First Name : <?php echo $_POST["name"]; ?><br>
Your Email: <?php echo $_POST["email"]; ?><br>
<?php
if(isset($_POST['submit'])){
$selected_val = $_POST['major']; // Storing Selected Value In
Variable
echo "You have selected :" .$selected_val; // Displaying Selected
Value
}
?><br>
<?php
if(isset($_POST['Q1']))
{
echo "You have selected :".$_POST['Q1']; // Displaying Selected
Value
}
?><br>
<?php
if(isset($_POST['Q2']))
{
echo "You have selected :".$_POST['Q2']; // Displaying Selected
Value
}
?><br>
<?php
if(isset($_POST['Q3']))
{
echo "You have selected :".$_POST['Q3']; // Displaying Selected
Value
}
?><br>
<?php
if(isset($_POST['Q4']))
{
echo "You have selected :".$_POST['Q4']; // Displaying Selected
Value
}
?><br>
</body>
</html>
and action-project-1.2.php ---
<html>
<body>
First Name : <?php echo $_POST["name"]; ?><br>
Your Password: <?php echo $_POST['passwd'];
?><br>
Show all Grades : <?php
if(isset($_POST['showwhat']))
{
echo "You have selected :".$_POST['showwhat']; // Displaying
Selected Value
}
?>
</body>
</html>
and here is the snapshot of the output ---
hey you can edit with your code .. what you want to do.. i am done from my side ..
please give me a like for my work and effort . Thank You !