Hey,
i would like to make 2 or more file_get_contents in 1 session. Please show me how is done. Here is what is have so far:
<?php
$url_login = 'http://test.com/index.php';
$postdata = http_build_query(
array(
'username' => 'user1',
'password' => '123',
'login' => 'true'
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-Type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$result = file_get_contents($url_login, false, $context);
echo $result;
//--So far ok, $result shows me that i am logged in--//
Here i am tring to make the secont file_get_contents but the session is lost and i get the login page.
$url_member_area = 'http://test.com/member_area.php';
$file = file_get_contents($url_member_area, false, $context);
// Now that i am logged in i want to access the member_area.php.
echo $file;
?>