How to access a variable across two files
I have three files - global.php, test.php , test1.php Global.php $filename; $filename = "test"; test.php $filename = "myfile.jpg"; echo $filename; test1.php echo $filename; I can read this variable from both test and test1 files by include 'global.php'; Now i want to set the value of $filename in test.php and the same value i want to read in test1.php. I tried with session variables as well but due to two different files i am not able to capture the variable. How to achieve this........ Thanks for help in advance..... Use: global.php <?php if(!session_id()) session_start(); $filename = "test";