0
我打算使用curl登錄一個網站。它的登錄狀態良好。現在我想知道會話的狀態,它是否存在。因爲用戶可以在登錄後發送不同頁面的請求。我的代碼在這裏。感謝php的狀態,curl會話
$url="https://mywebsite.com/login.pl";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "username=xxxxxx&passwd=xxxxx&client=xxxxx");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_MAXREDIRS, 4);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$store = curl_exec ($ch);
curl_close ($ch);
是什麼你的意思他們。其次,我將如何知道該會議還活着或已經死亡。所以我可以知道,我需要重新連接還是不需要。 – nbhatti2001