Lab 3

Submitted by Calina Winfield


Form with 10 PHP questions

First Name: *

Last Name: *



PHP Quiz
1. What does PHP stand for? *
PHP: Hypertext Preprocessor
Private Home Page
Personal Hypertext Processor


2. How do you write "Hello World" in PHP? *
"Hello World";
Document.Write("Hello World");
echo "Hello World";


3. The PHP syntax is most similar to: *
VBScript
Perl and C
JavaScript


4. Which superglobal variable holds information about headers, paths, and script locations? *
$GLOBALS
$_SESSION
$_SERVER
$_GET


5. What is the correct way to add 1 to the $count variable? *
$count =+1
++count
count++;
$count++;


6. How do you get information from a form that is submitted using the "get" method? *
$_GET[];
Request.Form;)
Request.QueryString;


7. Which one of these variables has an illegal name? *
$myVar
$my_Var
$my-Var


8. What is the correct way to open the file "time.txt" as readable? *
fopen("time.txt","r+");
open("time.txt","read");
open("time.txt");
fopen("time.txt","r");


9. How do you create an array in PHP? *
$cars = "Volvo", "BMW", "Toyota";
$cars = array("Volvo", "BMW", "Toyota");
$cars = array["Volvo", "BMW", "Toyota"];


10. How do you create a cookie in PHP? *
setcookie()
makecookie()
createcookie



Testing area: for Developers Only

Data collected from the form:
Name:
Answer for Q1:
Answer for Q2:
Answer for Q3:
Answer for Q4:
Answer for Q5:
Answer for Q6:
Answer for Q7:
Answer for Q8:
Answer for Q9:
Answer for Q10: