[請益] curl
我在處理session的時候
用CURLOPT_HEADER擷取session,然後用
CURLOPT_COOKIE修改下一頁Session的標頭
可是都寫不進去,請問有什麼辦法可以寫進下一頁的Session
現在我只到碰到JSESSIONID這一類的session名稱
我session都寫不進去header我已經嘗試過好幾次
不知道各位有什麼辦法..
另外..有人知道JSESSIONID是屬於哪一類的session嗎?
附上程式碼
$ch =
curl_init("http://xdcm.nmtl.gov.tw:8088/whos2app/servlet/whois?simplegenso");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
echo $output = curl_exec($ch);
curl_close($ch);
$output=substr($output,strpos($output,"JSESSIONID=")+11);
$SESSION=substr($output,0,strpos($output,"/")+1);
$ch =
curl_init("http://xdcm.nmtl.gov.tw:8088/whos2app/servlet/whois?textfield.1=".urlencode($KeyWord)."&go=");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_COOKIE, "JSESSIONID=".$SESSION."whos2app ");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
echo $output = curl_exec($ch);
curl_close($ch);
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 211.75.95.180
※ 編輯: wa120 來自: 211.75.95.180 (07/27 18:06)
※ 編輯: wa120 來自: 211.75.95.180 (07/27 18:09)
推
07/28 17:53, , 1F
07/28 17:53, 1F