Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

$_FILES is used to upload files to the server, not transfer values to another page. To transfer values to another page, you would typically use either GET or POST methods.

GET method is used when you want to transfer values in URL strings, for example when submitting a search form. The values are visible in the URL and can be bookmarked or shared.

POST method is used when you want to submit data to the server without showing the values in the URL. It is typically used for login forms, contact forms, or anything else where sensitive data may be submitted. The values are not visible in the URL and are transmitted as part of the HTTP request.

To transfer values using GET, you would typically use the following syntax:

Link to page

To transfer values using POST, you would typically use a form with hidden input fields:

<form action="page.php" method="POST"> <input type="hidden" name="name" value="value"> <input type="submit" value="Submit"> </form>

In both cases, the values can be accessed on the receiving page using the superglobal $GET or $POST array, depending on the method used.