Quiz 4 Spring 2024
Quiz 4 Spring 2024
1 – One method to pass data to the server from a client is GET; name another method (10
points)
2 – What is the name of the PHP class that we use to establish a connection to mysql on
the server and to execute SQL queries (10 points)
$email =
4 – We are coding an HTML file that will be included in a PHP script in which the
variable $price will be assigned a value. Include a PHP expression below that will
evaluate to whatever the value of $price is. (10 points)
5 – Inside a PHP script, we want to include an HTML file named Hi.html that includes a
few PHP expressions. What is true about the statement that includes that file? (10 points)
o True
o False
7 – SQL injection question: user input is expected to be an integer. You know that below
100, there is no result but there are results if the input is 100 or higher. What input would
use to find out if there is a table named test? Your input should be as generic as possible.
DO NOT use the keyword UNION. (10 points)
8 – When connecting to mysql using the constructor of the class in question 2, three
parameters are the server url, the user's login name and the user's password. What is the
4th parameter? (10 points)
10 – If we have the class A in file A.php and A contains a constant named USER, how
would you access USER from another PHP file (assuming A.php is correctly imported).
$user =