Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

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.

#57928
"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