[ Team LiB ] Previous Section Next Section

Workshop

Quiz

1:

Which function is designed to allow you to set a cookie on a visitor's browser?

2:

How would you delete a cookie?

3:

Which function could you use to escape a string for inclusion in a query string?

4:

Which element in the $_SERVER array can contain the raw query string?

5:

The name/value pairs submitted as part of a query string will be included in a built-in associative array. What is its name?


Answers

A1:

The setcookie() function enables you to set a cookie (although you could also output a Set-Cookie header using the header() function).

A2:

You can delete a cookie by calling setcookie() with a date that has already passed.

A3:

The urlencode() function translates a string so that it can be included in a query string.

A4:

The entire query string is made available to you in the $_SERVER['QUERY_STRING'] element.

A5:

The $_GET array contains the name/value pairs submitted as part of a query string.


    [ Team LiB ] Previous Section Next Section