Hello guys, nice forum you have here, im a happy new member with a happy problem
I have this code to get the Post results of a page and it works. my problem is that it doesnt work in pages that require login and cookies. how i can alter it in order to use cookies? for example for this page http://www.zazopoulossa.gr/index.php i need to send username and password, get the cookie and then send a new post message with the cookie.
$postdata = http_build_query(
array(
'keyword' => $code[$i]
)
);
$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('http://www.zazopoulossa.gr/index.php', false, $context);