Server IP : 172.16.15.8 / Your IP : 3.16.137.229 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/thchang/cs480/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php session_start(); // Title: assignment3a4.php // Author: Tyler Chang // Due: 2/17/2014 // Instructor: Dr. Wang // Goal: Secure page, show survey results // collect from last page $pass = $_SESSION['psw']; $first = $_SESSION['firstname']; $last = $_SESSION['lastname']; $gender = $_SESSION['gen']; $grade = $_SESSION['gra']; $course = $_SESSION['course']; $ans1 = $_POST['q1']; $comments1 = $_POST['q1comments']; $ans2 = $_POST['q2']; $comments2 = $_POST['q2comments']; $ans3 = $_POST['q3']; $comments3 = $_POST['q3comments']; $ans4 = $_POST['q4']; $comments4 = $_POST['q4comments']; // check password if($pass != "ch7hw") print "Incorrect Password. Try again."; else { ?> <CENTER> <FONT size=4> <B> Survey Results: </B> </FONT> <p> </CENTER> <?php print "Name: $first $last. "; if($gender == "m") print "Gender: Male. "; else if($gender == "f") print "Gender: Female. "; if($grade == "fr") print "Grade: Freshman. "; else if($grade == "so") print "Grade: Sophmore. "; else if($grade == "jr") print "Grade: Junior. "; else if($grade == "sr") print "Grade: Senior. "; print "Course: $course<p>"; ?> <B> Your Answers:<p> </B> You enjoyed this course: <?php if($ans1 == "s") print "You strongly agree<BR>"; else if($ans1 == "a") print "You agree<BR>"; else if($ans1 == "d") print "You disagree<BR>"; print "Your comments: $comments1<p>"; ?> You benefitted from this course: <?php if($ans2 == "s") print "You strongly agree<BR>"; else if($ans2 == "a") print "You agree<BR>"; else if($ans2 == "d") print "You disagree<BR>"; print "Your comments: $comments2<p>"; ?> Your instructor was effective: <?php if($ans3 == "s") print "You strongly agree<BR>"; else if($ans3 == "a") print "You agree<BR>"; else if($ans3 == "d") print "You disagree<BR>"; print "Your comments: $comments3<p>"; ?> You would recommend this course to a friend: <?php if($ans4 == "s") print "You strongly agree<BR>"; else if($ans4 == "a") print "You agree<BR>"; else if($ans4 == "d") print "You disagree<BR>"; print "Your comments: $comments4<p>"; ?> <A HREF=assignment3a.html> Done. </A> <?php } ?>