ahoj, kde je chyba? Proč to tu cookies nedělá?
<?php
$a=$_POST ['run'] ;
$data=array("username"=>"***", "domain"=>"seznam.cz" , "password" => "***", "loginType" => "seznam");
$url='https://login.szn.cz/loginProcess';
$verbose=1;
function postit($data,$url,$verbose){
$s="";
foreach($data as $key=>$val)
{
if (!empty($s)) $s.= '&';
$s.= $key.'='.urlencode($val);
}
// init
$ch = curl_init($url);
// set options
curl_setopt($ch, CURLOPT_HTTP_VERSION, 1.0);
curl_setopt($ch, CURLOPT_VERBOSE, $verbose);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$s);
// perform post
$rr=curl_exec($ch);
if ($verbose) echo $rr;
$ckfile = tempnam ("/tmp", "CURLCOOKIE") ;
curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckfile);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec ($ch);
/* STEP 3. visit cookiepage.php */
$ch = curl_init ($url);
curl_setopt ($ch, CURLOPT_COOKIEFILE, $ckfile);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec ($ch);
curl_close($ch);
}
postit($data, $url, true);
?>