几天来,我一直在尝试获取一个小的 PHP 脚本来登录 DOTNETNUKE 应用程序,但无济于事。我已经完全复制了标题和发布变量,因为它们是使用用于 firefox 的 Tamper Data 插件发送的。
每次我发送数据时,我都会收到以下错误:
error=你的%20session%20has%20expired.%20%20请%20try%20again
据我所知,这是因为 DOTNETNUKE Cookie 没有被传回,我不确定为什么会有任何帮助将不胜感激。我的 GUZZLE 代码如下:
include_once(LIBRARY_PATH . '/guzzle.phar');
use Guzzle\Http\Client;
use Guzzle\Plugin\Cookie\CookiePlugin;
use Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar;
$cookiePlugin = new CookiePlugin(new ArrayCookieJar());
$client = new Client('ASPX URL CODE GOES HERE');
$client->addSubscriber($cookiePlugin);
$client->setUserAgent('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0');
$response = $client->get('ASPX URL CODE GOES HERE')->send();
$request = $client->post('ASPX URL CODE GOES HERE', array(), array(
'__EVENTTARGET' => 'dnn$ctr383$LoginPage$SearchPage$dataPanel$ctl01$ctl13$LoginButton',
'__EVENTARGUMENT' => '',
'dnn$ReturnModuleFocus' => '',
'dnn$ModuleFocalPoint' => '',
'dnn$ModuleInvokedFromDataSearch' => '',
'dnn$ctr383$LoginPage$SearchPage$dataPanel$ctl01$ctl11$userName$mb_userName' => 'USERNAME HERE',
'dnn$ctr383$LoginPage$SearchPage$dataPanel$ctl01$ctl12$password$mb_password' => 'PASSWORD HERE',
'dnn$ctr383$LoginPage$SearchPage$dataPanel$ConfirmationSaveResponse' => '',
'dnn$ctr383$LoginPage$SearchPage$dataPanel$MinMax' => '',
'dnn$ctr383$LoginPage$SearchPage$dataPanel$dpPostBack' => '',
'ScrollTop' => '',
'__dnnVariable' => '',
'ScrollX' => '0',
'ScrollY' => '0',
'iCWindowID' => '2',
'iCRequestID' => '1',
'iCFieldsChanged' => '0',
'__VIEWSTATE' => ''
));
$response = $request->send();
echo $response;
提前谢谢!