Server IP : 172.16.15.8 / Your IP : 18.190.253.56 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/gmsnowman/public_html/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php session_start(); ?> <!-- File name: assn2aresults.php --> <?php $pass = $_SESSION['psw']; if($pass != "hw21") print "Go away."; else { ?> <center> <H2> Exam Results </H2> <HR> <?php //Assigning values to variables $a1 = $_POST['q1']; // "t", "f", "f", "f" $a2 = $_POST['q2']; // "f", "t", "f", "f" $a3 = $_POST['q3']; // "f", "f", "t", "f" $a4 = $_POST['q4']; // "f", "f", "f", "t" $score = 0; //Determining right or wrong answers and score if($a1 == "t") { $score += 25; print "Answer right for Q1!<P>"; } else { print "Wrong answer for Q1! The answer should be Subway.<P>"; } if($a2 == "f") print "Wrong answer for Q2! The answer should be Andesite. <p>"; else { $score += 25; print "Answer right for Q2!<P>"; } if($a3 == "3") { $score += 25; print "Answer right for Q3! <P>"; } else print "Wrong answer for Q3! The answer should be the Appalachian mountains. <P>"; if($a4 == "t") { $score += 25; print "Answer right for Q4! <P>"; } else print "Wrong answer for Q4! The answer should be 10,000."; ?> <HR> <?php //printing final score print "<P>Total score: $score%"; ?> </center> <?php } ?>