Все еще безуспешно.
Я думаю, что мне не хватает какой-то крошечной детали.
вот форма POST:
form name = "aspnetForm" method = "post" action = "default.aspx" id = "aspnetForm" autocomplete = "off"
input type = "hiden" name = "__ SPSCEditMenu" id = "__ SPSCEditMenu" value = "true" /
input type = "hidden" name = "MSOWebPartPage_PostbackSource" id = "MSOWebPartPage_PostbackSource" value = "" /
input type = "hidden" name = "MSOTlPn_SelectedWpId" id = "MSOTlPn_SelectedWpId" value = "" />
тип ввода = "скрытый" name = "MSOTlPn_View" id = "MSOTlPn_View" value = "0" />
input type = "hidden" name = "MSOTlPn_ShowSettings" id = "MSOTlPn_ShowSettings" value = "False" />
input type = "hidden" name = "MSOGallery_SelectedLibrary" id = "MSOGallery_SelectedLibrary" value = "" />
input type = "hidden" name = "MSOGallery_FilterString" id = "MSOGallery_FilterString" value = "" />
input type = "hidden" name = "MSOTlPn_Button" id = "MSOTlPn_Button" value = "нет" />
тип ввода = "скрытое" имя = "__ REQUESTDIGEST" id = "__ REQUESTDIGEST" значение = "0xFFD5F7BB65113ADA485BE8F57AF640C45348305D1590E21AEF42305F6FB76DAF255DAD98F5110B3030800005C5105C1105C5105C5105C5105C5105C5105B5B1R5C5105B5R5B1R1R5C5B5C5B1R1R1R1R5B5B1R1R1R5B5B1R1R5C5B5C5B5R5B1C5B1C5B1C5B1R1R1R1R3B1R1R1R3B1R1R1R1R5
input type = "hidden" name = "MSOAuthoringConsole_FormContext" id = "MSOAuthoringConsole_FormContext" value = "" />
input type = "hidden" 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 = "" />
input type = "hidden" name = "MSOSPWebPartManager_OldDisplayModeName" id = "MSOSPWebPartManager_OldDisplayModeName" value = "Обзор" />
input type = "hidden" name = "MSOSPWebPartManager_StartWebPartEditingName" id = "MSOSPWebPartManager_StartWebPartEditingName" value = "false" />
input type = "hidden" name = "__ VIEWSTATE" id = "__ VIEWSTATE" value = "/ wEPDwUBMA9kFgJmD2QWAgIBDxYCH ==" />
и вот код, который я использую:
функция http ($ target, $ ref, $ method, $ 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
Я использую этот URL, который я извлек из заголовка Live HTPP для формы:
https://www.cellcom.co.il/siteminderagent/forms/login.fcc
Что ты думаешь?
имеет ли смысл?