下面是我尝试在网站上登录的代码。我不知道什么不起作用,网站可能改变了一些东西,我不适合我。我不知道会发生什么。
$var = file_get_contents("http://www.dauanunt.ro/cont/login");
$q = explode("name=\"q\" value=\"",$var);
$q = explode("\" />",$q[1]);
$q = $q[0];
$ga_bi['a'] = 'login';
$ga_bi['q'] = $q;
$ga_bi['h'] = '';
$ga_bi['u'] = 'gabrielaromania66@gmail.com';
$ga_bi['p'] = 'testing';
$ga_bi['r'] = '1';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.dauanunt.ro/cont/login');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_REFERER, "http://www.dauanunt.ro");
curl_setopt($ch, CURLOPT_POSTFIELDS, $ga_bi);
$result = curl_exec($ch);
curl_close($ch);
echo $result;