hassanz25 Posted October 28, 2007 Share Posted October 28, 2007 Hi everybody, if I load a php page from controller.php like this: $handle = fopen("http://localhost/MvCphp_1.0/View/maincatgory.php", "rb"); echo stream_get_contents($handle); fclose($handle); then the created session, in the file where I am running the above code, for instance $_Sesssion['hr']='ge'; will not be accessible in echoed file above "maincatgory.php" I don't know why? and I want to know how can I access...? Please Help Cheers, Quote Link to comment https://forums.phpfreaks.com/topic/75062-accessing-session-in-a-php-page-echoed-by-fstream/ Share on other sites More sharing options...
trq Posted October 28, 2007 Share Posted October 28, 2007 Calling a file via fopen parses the php it contains and gives you back the resulting page. If you wanted to access variables from within the calling page you need to use include. Quote Link to comment https://forums.phpfreaks.com/topic/75062-accessing-session-in-a-php-page-echoed-by-fstream/#findComment-379633 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.