global variable or constant that will be visible in file2.php. File2.php includes file1.php.
I tried to accomplish this with session for example like this.
file1.php
Code: Select all
<?php
session_start()
If (something){
define('MYCONST',5);
}
Else {
define ('MYCONST',6);
}
Code: Select all
Include file1.php
Session_start();
Echo MYCONST;
i first run file1
Then on press of the button i run file2.php
Can anyone suggest what i am doing wrong please