<?php
$ckfile = tempnam("/tmp", "CURLCOOKIE");
$url = "http://portal.kinsyp.local/kadanza/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
/*curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, $ckfile);
curl_setopt($ch, CURLOPT_COOKIEFILE, $ckfile);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
//curl_setopt($curl, CURLOPT_COOKIE, session_name() . '=' . session_id());
$html = curl_exec($ch);*/
$postfields = array();
$postfields["user"] = "uniwan";
$postfields["pass"] = "uniwan";
$postfields["logintype"] = "login";
$postfields["pid"] = "20";
$useragent = "Mozilla/5.0";
curl_setopt($ch, CURLOPT_COOKIEFILE,$ckfile);
curl_setopt($ch, CURLOPT_COOKIEJAR,$ckfile);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
//curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
//curl_setopt($curl, CURLOPT_COOKIE, session_name() . '=' . session_id());
$result = curl_exec($ch);
$last_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
echo $result
?>