Workshop

The workshop is designed to help you anticipate possible questions, review what you've learned, and begin putting your knowledge into practice.

Quiz

1:

Which predefined variable do you use to find the name of the script?

A1:

The variable $_SERVER['PHP_SELF']' holds the name of the script.

2:

Which built-in associative array contains all values submitted as part of a POST request?

A2:

The $_POST superglobal.

3:

Which built-in associative array contains all values submitted as part of a file upload?

A3:

The $_FILES superglobal.

4:

What function do you use to redirect the browser to a new page?

A4:

The header() function.

5:

What are the four arguments used by the mail() function?

A5:

The recipient, the subject, the message string, and additional headers.

6:

How do you limit the size of a file that a user can submit via a particular upload form?

A6:

Use a hidden field called MAX_FILE_SIZE in your form.

Activities

  1. Create a calculator script that enables the user to submit two numbers and choose an operation (addition, multiplication, division, or subtraction) to perform on them.

  2. Use hidden fields with the script you created in activity 1 to store and display the number of requests that the user submitted.



Sams Teach Yourself PHP, MySQL and Apache in 24 Hours
Sams Teach Yourself PHP, MySQL and Apache in 24 Hours
ISBN: 067232489X
EAN: 2147483647
Year: 2005
Pages: 263

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net