仍然沒有成功。 我想我錯過了一些小細節。
這裏是POST形式:
形式名稱= 「aspnetForm」 方法= 「郵報」 行動=「默認值。ASPX」 ID = 「aspnetForm」 自動填充= 「關閉」
INPUT TYPE = 「隱伏」 名稱= 「__ SPSCEditMenu」 ID = 「__ SPSCEditMenu」 值= 「真」/ INPUT TYPE = 「隱藏」 名稱= 「MSOWebPartPage_PostbackSource」 id =「MSOWebPartPage_PostbackSource」value =「」/ input type =「hidden」name =「MSOTlPn_SelectedWpId」id =「MSOTlPn_SelectedWpId」value =「」/> input type =「hidden」name =「MSOTlPn_View」id =「MSOTlPn_View」值= 「0」/>
INPUT TYPE = 「隱藏」 名稱= 「MSOTlPn_ShowSettings」 ID = 「MSOTlPn_ShowSettings」 值= 「假」/> INPUT TYPE = 「隱藏」 名稱= 「MSOGallery_SelectedLibrary」 ID =「MSOGallery_SelectedLibrary 「value =」「/> input type =」hidden「name =」MSOG allery_FilterString「id =」MSOGallery_FilterString「value =」「/> input type =」hidden「name =」MSOTlPn_Button「id =」MSOTlPn_Button「value =」none「/> input type =」hidden「name =」__ REQUESTDIGEST「id = 「__ REQUESTDIGEST」 值= 「0xFFD5F7BB65113ADA485BE8F57AF640C45348305D1590E21AEF42305F6FB76DAF255DAD98F5110B3065ADAC1AE647B87F1309481C513057EC9C2C9EB5C71770D4,15 2010年1月19點29分23秒-0000」/> INPUT TYPE = 「隱藏」 名稱= 「MSOAuthoringConsole_FormContext」 ID = 「MSOAuthoringConsole_FormContext」 值= 「」/> INPUT TYPE =」隱藏「name =」MSOAC_EditDuringWorkflow「id =」MSOAC_EditDuringWorkflow「value =」「/> input type =」hidden「name =」MSOSPWebPartManager_DisplayModeName「id =」MSOSPWebPartManager_DisplayModeName「value =」瀏覽「/> input type =」hidden「name =「MSOWebPartPage_Shared」id =「MSOWebPartPage_Shared」value =「」/> input type =「hidden」name =「MSOLayout_LayoutChanges」id =「MSOLayout_LayoutChanges」value =「」/> input type =「hidden」name =「MSOLayout_InDesignMode」id =「MSOLayout_InDesignMode」value =「」/> 「hidden」name =「MSOSPWebPartManager_OldDisplayModeName」id =「MSOSPWebPartManager_OldDisplayModeName」value =「Browse」/> input type =「hidden」name =「MSOSPWebPartManager_StartWebPartEditingName」id =「MSOSPWebPartManager_StartWebPartEditingName」value =「false」/> input type =「hidden」 「名稱=」 __ VIEWSTATE」 ID = 「__ VIEWSTATE」 值= 「/ wEPDwUBMA9kFgJmD2QWAgIBDxYCH ==」/>
,這是我使用的代碼: 功能HTTP($目標,$ REF,$方法,$ data_array中,$ incl_head) { #初始化PHP/CURL句柄 $ ch = curl_init();
# HEAD method configuration
if($method == HEAD)
{
curl_setopt($ch, CURLOPT_HEADER, TRUE); // No http head
curl_setopt($ch, CURLOPT_NOBODY, TRUE); // Return body
}
else
{
# GET method configuration
if($method == GET)
{
if(isset($query_string))
$target = $target . "?" . $query_string;
curl_setopt ($ch, CURLOPT_HTTPGET, TRUE);
curl_setopt ($ch, CURLOPT_POST, FALSE);
}
# POST method configuration
if($method == POST)
{
if(isset($data_array))
curl_setopt ($ch, CURLOPT_POSTFIELDS, $data_array);
curl_setopt ($ch, CURLOPT_POST, TRUE);
curl_setopt ($ch, CURLOPT_HTTPGET, FALSE);
}
curl_setopt($ch, CURLOPT_HEADER, $incl_head); // Include head as needed
curl_setopt($ch, CURLOPT_NOBODY, FALSE); // Return body
}
curl_setopt($ch, CURLOPT_COOKIEJAR, COOKIE_FILE); // Cookie management.
curl_setopt($ch, CURLOPT_COOKIEFILE, COOKIE_FILE);
curl_setopt($ch, CURLOPT_TIMEOUT, CURL_TIMEOUT); // Timeout
curl_setopt($ch, CURLOPT_USERAGENT, WEBBOT_NAME); // Webbot name
curl_setopt($ch, CURLOPT_URL, $target); // Target site
curl_setopt($ch, CURLOPT_REFERER, $ref); // Referer value
curl_setopt($ch, CURLOPT_VERBOSE, FALSE); // Minimize logs
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // No certificate
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); // Follow redirects
curl_setopt($ch, CURLOPT_MAXREDIRS, 4); // Limit redirections to four
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Return in string
我使用這個網址是我從現場HTPP頭提取形式: https://www.cellcom.co.il/siteminderagent/forms/login.fcc
什麼ü想的? 它有道理嗎?
請告訴我們迄今爲止所做的一切,代碼明智。 – codaddict 2010-01-15 11:45:33
這是我使用的模板: http://www.mediafire.com/?yyn0yt4ezxy 謝謝 – Embedded 2010-01-15 12:30:13