Accessing session in a php page echoed by fstream

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hassanz25
Forum Newbie
Posts: 1
Joined: Mon Oct 29, 2007 6:54 am

Accessing session in a php page echoed by fstream

Post by hassanz25 »

scottayy | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi everybody,

if I load a php page from controller.php like this:

Code: Select all

$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,


scottayy | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It's a remote request. Remote request will not receive any data you do not directly send to them.

Why not use (a local file reference with) include()?
Post Reply