Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am building a web based questionaire and I am stuck. I am using html and php to handle interactions but I need to export

I am building a web based questionaire and I am stuck. I am using html and php to handle interactions but I need to export the results to a .txt file as shown in the picture below. It also needs to have an admin login using admin as user and admin as the password. I have all of the html components built but I havnt figured out how to handle the admin login and file export. The buttons below the admin login are the sort by options, any help would be appreciated.

code below

keeping all your input

function validate_input($input) { $input = trim($input); $input = htmlspecialchars($input); return $input; }

$name = $email = ""; $nameMsg = $emailMsg = ""; $major = ""; $q1 = ""; $q2 = ""; $q3 = ""; $q4 = ""; $showAnswer = ""; $emailErr = FALSE; $boolShowAns = FALSE; $count = 0; $value =""; $adminName = ""; $adminPass = "";

if(isset($_POST["submit"])) { $name = validate_input($_POST["name"]); $email = validate_input($_POST["email"]); $major = validate_input($_POST["major"]); $q1 = validate_input($_POST["Q1"]); $q2 = validate_input($_POST["Q2"]); $q3 = validate_input($_POST["Q3"]); $q4 = validate_input($_POST["Q4"]); $showAnswer = validate_input($_POST["showanswer"]);

if(empty($name)) $nameMsg = "Missing";

if(empty($email)) { $emailMsg = "Missing"; $emailErr = TRUE; } else if(!filter_var($email, FILTER_VALIDATE_EMAIL)) { $emailMsg = "Email is not in the correct format!"; $emailErr = TRUE; } else $emailErr = FALSE;

if($showAnswer == "Yes") $boolShowAns = TRUE; else $boolShowAns = FALSE;

if(empty($name) || $emailErr) $boolShowAns = FALSE; } if(isset($_POST["submitme"])); { $value = $_POST["showwhat"]; $adminName = validate_input($_POST["adminName"]); $adminPass = validate_input($_POST["passwd"]); }

?>

Welcome to this Web Based Test!!!

Please answer the following questions:


Name: * E-mail: *
Choose your major area of study:

Questons 1 (25points)

What is PHP for?

>A. Purple Dinosaur pictures >B. Dynamic Web Pages >C. Picking hot potatoes >D. Accessing emails

Questons 2 (25points)

What browser supports PHP?

>A. Chrome >B. Internet Explorer >C. Firefox >D. All of the above

Questons 3 (25points)

What year was PHP released?

>A. 1995 >B. 1482 >C. 1882 >D. 2024

Questons 4 (25points)

Who type of scripting language is PHP?

>A. Server Side >B. Imagination Side >C. Special Sauce Side >D. Hilton Inn
> Show correct answers after submission.



Admistrator ID: > * Password: > *

Show all grades Show all grades sorted descendly Show all grades that are 100 Show all grades that are 0 and are of Digital Media Major Find student(s)'s grade by name:


if(isset($_POST["submit"])) {

if($q1 == "B") $count++; if($q2 == "D") $count++; if($q3 == "A") $count++; if($q4 == "A") $count++;

$grade = ($count / 4) * 100;

if (empty($name) || $emailErr) { echo "You are missing your name and email. Please fill out the form."; } else { echo "Name: ".$name."
"; echo "Email: ".$email."
"; echo "Major: ".$major."
"; echo "Your grade for this test is: %".$grade."
"; } } ?>

image text in transcribed

image text in transcribed

Mail -jwise@ggcedu , drlaial tervista.org/ITEC4450/Prox + The grade for each student is shown as follows. o. Name Grade IP address bbb@abc.com bbb@abc.com abc.com atas Digial Media 100 24.125.138.102 24.125.138.102 24.125.138.102 24.125.138.102 Security 75 lai@ggc.edu asdf hotmail.com nternetinternet.com inspiritsj93@gmail.com asdfggc.ecu asdfggc.ecu asdfggc.ecu asdfggc.ecu asdfggc.ecu asdfggc.ecu asdfggc.ecu asdfggc.ecu asdfggc.ecu asdfggc.ecu CIunozl@ggc edu CIunozl@ggc edu CIunozl@ggc edu Business 50 168.28.22.146 00 168.28.22.146 Digial Medial 100168.28.22.146 Digital Media 50.147.203.70 Digital Media 2550.147.203.70 Digital Media 2550.147.203.70 Digital Media 2550.147.203.70 Digital Media 2550.147.203.70 Digial Media 00 50.147.203.70 50.147.203.70 Digital Media 50.147.203.70 50.147.203.70 00 50.147.203.70 Digial Medial 100168.28.22.146 Digial Media 75168.28.22.146 Digial Media 50 168.28.22.146 Digial Media 75168.28.22.146 Digial Medial 100168.28.22.146 Digial Media 50 168.28.22.146 Digial Media 50 168.28.22.146 Digial Medial 100168.28.22.146 Digial Media 75168.28.22.146 Digial Media 75168.28.22.146 Digital Media 168.28.22.146 5 Some Guy Business Alex Bui 7 asdf S asd 10 sdf l sdf 12 asdf 13 asdf 14 asdf 15 asdf 6 asdf 17 Carlos 18 Carlos 19 Carlos 20 Dude 21 Dude 22 hello 23 hello 24 carlos 25 carlos 26 carlos Business Security gmail.com gmail.com ggggc.edu ggggc.edu CIunozl@ggc edu CIunozl@ggc edu CIunozl@ggc edu CIunozl@ggc edu 7 carlos G:09 PM O Type here to search 3/12/2019 e Get Homework Help With ChegXNterista. Free web space @Project for keeping all your input : Not secure l iwise.altervista.org/Project 2.php B. Internet Explorer C. Firefox D. All of the above Questons 3 (25points) What year was PHP released? OA, 1995 B. 1482 C. 1882 D. 2024 Questons 4 (25points) Who type of scripting language is PHP? A. Server Side B. Imagination Side C. Special Sauce Side D. Hilton Inn Show correct answers after submission Suhmt this test Reset Password Show all grades Show all grades sorted descendly Show all gracdes that are 100 Show all grades that are 0 and are of Digital Media Majo Find studeut(s)'s grade by name: See grades Reset O :16 PM 3/12/2019 Type here to search Mail -jwise@ggcedu , drlaial tervista.org/ITEC4450/Prox + The grade for each student is shown as follows. o. Name Grade IP address bbb@abc.com bbb@abc.com abc.com atas Digial Media 100 24.125.138.102 24.125.138.102 24.125.138.102 24.125.138.102 Security 75 lai@ggc.edu asdf hotmail.com nternetinternet.com inspiritsj93@gmail.com asdfggc.ecu asdfggc.ecu asdfggc.ecu asdfggc.ecu asdfggc.ecu asdfggc.ecu asdfggc.ecu asdfggc.ecu asdfggc.ecu asdfggc.ecu CIunozl@ggc edu CIunozl@ggc edu CIunozl@ggc edu Business 50 168.28.22.146 00 168.28.22.146 Digial Medial 100168.28.22.146 Digital Media 50.147.203.70 Digital Media 2550.147.203.70 Digital Media 2550.147.203.70 Digital Media 2550.147.203.70 Digital Media 2550.147.203.70 Digial Media 00 50.147.203.70 50.147.203.70 Digital Media 50.147.203.70 50.147.203.70 00 50.147.203.70 Digial Medial 100168.28.22.146 Digial Media 75168.28.22.146 Digial Media 50 168.28.22.146 Digial Media 75168.28.22.146 Digial Medial 100168.28.22.146 Digial Media 50 168.28.22.146 Digial Media 50 168.28.22.146 Digial Medial 100168.28.22.146 Digial Media 75168.28.22.146 Digial Media 75168.28.22.146 Digital Media 168.28.22.146 5 Some Guy Business Alex Bui 7 asdf S asd 10 sdf l sdf 12 asdf 13 asdf 14 asdf 15 asdf 6 asdf 17 Carlos 18 Carlos 19 Carlos 20 Dude 21 Dude 22 hello 23 hello 24 carlos 25 carlos 26 carlos Business Security gmail.com gmail.com ggggc.edu ggggc.edu CIunozl@ggc edu CIunozl@ggc edu CIunozl@ggc edu CIunozl@ggc edu 7 carlos G:09 PM O Type here to search 3/12/2019 e Get Homework Help With ChegXNterista. Free web space @Project for keeping all your input : Not secure l iwise.altervista.org/Project 2.php B. Internet Explorer C. Firefox D. All of the above Questons 3 (25points) What year was PHP released? OA, 1995 B. 1482 C. 1882 D. 2024 Questons 4 (25points) Who type of scripting language is PHP? A. Server Side B. Imagination Side C. Special Sauce Side D. Hilton Inn Show correct answers after submission Suhmt this test Reset Password Show all grades Show all grades sorted descendly Show all gracdes that are 100 Show all grades that are 0 and are of Digital Media Majo Find studeut(s)'s grade by name: See grades Reset O :16 PM 3/12/2019 Type here to search

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions

Question

Understanding Group Leadership Culture and Group Leadership

Answered: 1 week ago