php_mysql_apache [Electronic resources]

Julie C. Meloni

نسخه متنی -صفحه : 323/ 106
نمايش فراداده

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?

2:

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

3:

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

4:

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

5:

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

6:

On the client side, how do you limit the size of a file that a user can submit via a particular upload form?

Answers

A1:

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

A2:

The $_POST superglobal.

A3:

The $_files superglobal.

A4:

The header() function, along with a location.

A5:

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

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.