Home › Forums › Back End › How do I send a PHP variable to another file. › Re: How do I send a PHP variable to another file.
May 21, 2009 at 7:09 pm
#57928
davesgonebananas
Member
"mattvot" wrote:
How would I send a php variable to another php file?
You don’t really send variables in php. If you include another php file, the included file will have access to all global variables.
If you want to keep the value of some variable between page requests then you will need to store the value somewhere. The easiest places to store values are in cookies, sessions or a database. Which one you use depends on the exact scenario.
http://www.w3schools.com/PHP/php_includes.asp
http://www.w3schools.com/PHP/php_sessions.asp