Page 1 of 1

how to save contents of file in SESSION variable

Posted: Thu Dec 14, 2006 6:24 am
by eshban
Hi , i have a question.

i read the contents of the file by method

Code: Select all

file_get_contents
can i save these contents of file in a SESSION varaible to access it on other page and write the file on that other page.

Please tell me any solution.

Thanks

Posted: Thu Dec 14, 2006 7:23 am
by amir
Try,

Code: Select all

$_SESSION['sess_avr'] = file_get_contents("http://www.example.com");
and then on another page, get this data through

Code: Select all

$_SESSION['sess_avr'];
Sure start session on each page.

BOL!