Question
Create a web page for the GGC PHP Club. This page will collect users information such as name, email, gender, and/or other information you would
Create a web page for the GGC PHP Club. This page will collect users information such as name, email, gender, and/or other information you would like to collect. This page will give users 5 questions to test userss PHP level. Please find or make appropriate PHP questions. Each question is 20 points. If a users score is less than 60, its the beginners level. If the score is between 60 and 79, its the experienced programmers level. If the score is 80 or above, its the gurus level. After the user submits, show the users basic information, test score, and level on another page. Please decorate the pages as you like.
Create a web page to show the statistics of the PHP test. Record the users answers to the demographic questions such as name, email, gender, major, etc, and the answers to 5 PHP questions in a text file. You web page will show the avearge score of all the users, the average scores of the male/female users, and average scores of users from each major. Also use meters to compare the number of beginners/programmers/gurus in each major(Digital media, software development, security, business). At the bottom of the page, show all the submitted information of all the users.
Make a table, for each question, show the percentage of users selecting each option. Mark the correct answers with a different color.
This is what i have so far. i have the first part done. except for calculating the scores.
function format_input($input) //YOU NEED TO HAVE THIS FUNCTION FOR SECURITY CONCERNS!!!!!!!!!!!!!!!!! { $input = trim($input); $input = htmlspecialchars($input); return $input; }
if(isset($_POST['submit'])) //This is how to say that if the name has nothing in it, a display message will say Name is required. If it is inputed, then follow the format_input { if(empty($_POST['name'])) $nameError = "Name is required!"; else $name = format_input($_POST['name']); if(empty($_POST['email'])) $emailError = "Email is required!"; else { $email = format_input($_POST['email']); //also need to check if in email format if(!filter_var($email, FILTER_VALIDATE_EMAIL)) //if email is NOT (!) in the filtered variable of email format then display message $emailError = "Email is incorrect, please try again!"; } if($_POST['major']) $major = format_input($_POST['major']); if($_POST['Q1']) $Q1 = format_input($_POST['Q1']); if($_POST['Q2']) $Q2 = format_input($_POST['Q2']); if($_POST['Q3']) $Q3 = format_input($_POST['Q3']); if($_POST['Q4']) $Q4 = format_input($_POST['Q4']); if($_POST['Q5']) $Q4 = format_input($_POST['Q5']); if($_POST['showanswer']) $showanswer = format_input($_POST['showanswer']); } ?>
PHP Quiz
"; echo "Name: ".$name."
"; echo "Email: ".$email."
"; echo "Major: ".$major."
";
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started