The question speaks for itself, but is there any other method?
Could you kindly share them even if those are the best practices?
The question speaks for itself, but is there any other method?
Could you kindly share them even if those are the best practices?
Those are the most obvious ways to input information into a page. It is possible to parse the input from the url in another way than $_GET
, but why would you.
Also, you can use other methods. For instance, you could save information in a file or database and read it in the next page, although you might still need some information in a cookie or the url to identify which information to read (session id).
So, while strictly the answer to your question is 'no', I want to say 'yes', these are the methods you will commonly use.
If it's strictly about those global variables, then you've got the $_REQUEST
variable, which basically collects all values from $_GET
, $_POST
and $_COOKIE
together. And $_FILES
gives information about uploaded files, which are automatically stored in a temporary location, although in essence, those files are also posted to the page. So, these globals help you making things easy regarding the most common methods to communicate with a script.
All these are for input, by the way. You cannot send information back, or to the next page, by modifying these $_SUPERGLOBALS
.