Ask Your Question
3

What is the method of transferring a value to another page using $_FILES?

asked 2023-06-24 14:13:04 +0000

ladyg gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-06-24 14:38:02 +0000

david gravatar image

$_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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-24 14:13:04 +0000

Seen: 11 times

Last updated: Jun 24 '23