我使用此代码注册站点..但它显示“您的会话已过期,请重新登录”
似乎我有一些 cookie 问题......但我不明白问题是什么......
它不是完整的代码。我只是发布了它的主要部分......
<?php
session_start();
$r=rand(1,999999999);
$cookie=$r;
$finalcookie="cookie/".$r.".txt";
$_SESSION['cookie']=$r;
$url="http://www.ypox.com";
$login="$url/content/login.html";
$signup="$url/content/signup.action";
$agent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0";
$name="Arijit";
$email="dibbyo456@gmail.com";
$mobile="8798147385";
$cap="captcha";
$data="hidGen=Mr&tfUserName=$name&tfMobileNum=$mobile&tfUserID=$email&date1=10%2F10%2F1980&tfReferCode=&textcode=$cap&checkaccept=on";
curl_setopt($ch, CURLOPT_URL, $signup);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_COOKIEJAR,$finalcookie);
curl_setopt($ch, CURLOPT_COOKIEFILE,$finalcookie);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_REFERER, $login);
$html=curl_exec($ch);
echo $html;