Login | Contact Us | Site Map | Resources

Advanced PHP Quiz

Log in before taking this test if you want your score to be saved in order to receive a certification of achievement. If you are not yet a member, you can register free of charge.

1. Why is the use of mysql_real_escape_string() so important?

It Protects Against SQL Injection Attacks

It Escapes Special Characters

It Reduces The Possibility of Malicious Code Being Executed

It Makes User Input Data Harmless When Added Into a Query

All of These Options Are Correct


2. The (fill in the blank) must be specified in the header() function before any other output is sent to the browser.

Image-type

Content-type

Header-type


Bonus Question: David's father had three sons: Snap, Crackle, and ?

David

Pop

Gurgle

Peter

Hop


3. The imagecreate() function is used to draw a border around an image.

True

False


4. What data is stored in the $_SERVER['REMOTE_ADDR'] superglobal?

The Server's IP Address

The Visitor's IP Address

The Visitor's Mailing Address

The Visitor's MAC Address


5. What is the difference between the $_GET[] and $_POST[] superglobals?

$_GET[] Sends Form Data Via the URL and $_POST[] Sends Form Data Behind-the-Scenes

$_POST[] Sends Form Data Via the URL and $_GET[] Sends Form Data Behind-the-Scenes


6. What is the limit of form data that can be transferred via $_GET[] and $_POST[], respectively?

25 Characters & 2MB

50 Characters & 4MB

100 Characters & 8MB

200 Characters & 16MB

100 Characters & 4MB


7. Which function will read an opened file one line at a time?

fread()

fgets()

feof()

filesize()


8. What is stored in the visitor's browser, can be edited by the visitor and can last years?

Sessions

Segments

Cookies

Cupcakes


9. Which PHP functions are used to open and close a MYSQL connection?

mysql_open() & mysql_close()

mysql_open() & mysql_disconnect()

mysql_connect() & mysql_close()

mysql_connect() & mysql_disconnect()


10. Which function will return the number of rows affected by a query, regardless of the type of query?

mysql_affected_rows()

mysql_num_rows()


Bonus Question: What has one head, one foot and four legs?

A Giraffe

A Centipede

A Bed

A Pumpkin

A Clock


11. Which function will return query results as an enumerated array?

mysql_fetch_array()

mysql_fetch_assoc()

mysql_fetch_lengths()

mysql_fetch_object()

mysql_fetch_row()


12. Which function will return a URL to you in segments?

get_headers()

urldecode()

get_meta_tags()

parse_url()

urlencode()


13. Which image function is used to assign colors?

imagegif()

imagefilltoborder()

imagecreatetruecolor()

imagecreate()

imagecolorallocate()


14. Should checkbox names be unique, or should radio button names be unique?

Checkbox Names Should Be Unique to Each Checkbox (Radio Button Names Should Be Identical)

Radio Button Names Should Be Unique to Each Radio Button (Checkbox Names Should Be Identical)


15. When opening a file with the fopen() function, which option will open a file for writing only, and place the pointer at the end of the file?

r+

w

w+

c

a