CODE
function createPostString($aPostFields) {
foreach ($aPostFields as $key => $value) {
$aPostFields[$key] = urlencode($key) . '=' . urlencode($value);
}
return implode('&', $aPostFields);
}
$postFields['email'] = 'mojemail';
$postFields['password'] = 'haselko';
$ch = curl_init('https://www.strona/login.php?url=%2Fpodstrona.php');
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3');
curl_setopt($ch, CURLOPT_POSTFIELDS, createPostString($postFields));
curl_setopt( $ch, CURLOPT_POST, TRUE );
curl_exec($ch);
curl_close($ch);
?>
foreach ($aPostFields as $key => $value) {
$aPostFields[$key] = urlencode($key) . '=' . urlencode($value);
}
return implode('&', $aPostFields);
}
$postFields['email'] = 'mojemail';
$postFields['password'] = 'haselko';
$ch = curl_init('https://www.strona/login.php?url=%2Fpodstrona.php');
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3');
curl_setopt($ch, CURLOPT_POSTFIELDS, createPostString($postFields));
curl_setopt( $ch, CURLOPT_POST, TRUE );
curl_exec($ch);
curl_close($ch);
?>
Jednak po odpaleniu skryptu w przeglądarcę widac jedynie stronę logowania danego aadresy wiec jak widać nie dziala. Co moze byc przyczyna? Nie za bardzo wiem jak sie za to zabrac..