I'm dyeing to know how to do this.
Actually I have two php page. Say page1.php and page2.php.
Now say in page1.php we have something like
<?php
$id=$_GET['id'];
// do some processing with mysql database
// do some more processing
$name="Kumar Ravi"; // this is the name generated using ID received.
echo $name;
?>
and in page2.php, we have
<?php
$var=get_the_output('page1.php?id=24');
echo $var;
?>
How can make something like this, I mean I want to have all the data echoed by another PHP (which can only be called using a GET request) into a string on another PHP page.
I have tried many things but failed. Things I tried are:
- file_get_contents ---> failed as it was unable to maintain session present in page2.php to page1.php
- require ---> as I don't know how to pass parameter and maintain the session using this. Tried to search everywhere but.. :(
Please help.