I was wondering how I could get the html from a certain page and put it into a variable. I managed to do this but once I tested I realized it lost the session. I need it to keep the login session while obtaining the html.
Using this code I got the html but lost the session
Code:
function get_content($url)
{
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_HEADER, 0);
ob_start();
curl_exec ($ch);
curl_close ($ch);
$string = ob_get_contents();
ob_end_clean();
return $string;
}
I noticed when using IFrame it keeps the session, how can I do something like this? If it is actually a complicated thing I am willing to pitch out a few dollars for your help.