使用 snoopy php 类在 ASPX 页面上提交表单 - 视图状态问题

发布于 2024-10-31 07:25:22 字数 1175 浏览 1 评论 0原文

我正在使用 snoopy 在另一个网站的 .aspx 页面上提交表单。我已经从该表单中获取了所有标头/cookie 和值,并使用 Snoopy 将其传递给表单。然而我收到了“viewstate”错误,即“Viewstate 无效”。我已经从表单的源代码中复制了视图状态字段并传递了它。但是,它仍然给出相同的错误。

谁能告诉我如何在该 .aspx 表单上提交表单。以下是我正在使用的代码:

$snoopy->referer="http://www.URL.com/default.aspx";
$snoopy->agent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
$snoopy->rawheaders['Content-Type']="application/x-www-form-urlencoded"; 
$snoopy->rawheaders['Cache-Control']="private";
$snoopy->cookies['ASP.NET_SessionId']="adeqeteqerqrqqeq";


$submit_vars['__EVENTTARGET']="";
$submit_vars['__EVENTARGUMENT']=""; 
$submit_vars['__LASTFOCUS']="";
$submit_vars['__VIEWSTATE']=urldecode("/qqeaddgqradeapoioq==");
$submit_vars['__EVENTVALIDATION']=urldecode("/addafadfaerttq/aa/yqea");
$submit_vars['ctl00$ContentPlaceHolder1$lstc']="1";
$submit_vars['ctl00$ContentPlaceHolder1$lstm']="11";
$submit_vars['ctl00$ContentPlaceHolder1$lstce']="16";
$submit_vars['ctl00$ContentPlaceHolder1$lstt']="18289";
$submit_vars['ctl00$ContentPlaceHolder1$btnSad']="Submit";

$submit_url = "http://www.URL.com/Default.aspx";

$snoopy->submit($submit_url,$submit_vars);

谢谢

I am using snoopy to submit a form on a .aspx page of another website. I have grabbed all the headers/cookies and values from that form and passing it to the form with Snoopy. It is going to that however i am getting error of "viewstate" that is "Viewstate is invalid". I have copied the view state field from the form's source code and pass it as well. However, still it is giving same error.

Can anyone let me know how can i submit a form on that .aspx form. Below is the code i am using :

$snoopy->referer="http://www.URL.com/default.aspx";
$snoopy->agent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
$snoopy->rawheaders['Content-Type']="application/x-www-form-urlencoded"; 
$snoopy->rawheaders['Cache-Control']="private";
$snoopy->cookies['ASP.NET_SessionId']="adeqeteqerqrqqeq";


$submit_vars['__EVENTTARGET']="";
$submit_vars['__EVENTARGUMENT']=""; 
$submit_vars['__LASTFOCUS']="";
$submit_vars['__VIEWSTATE']=urldecode("/qqeaddgqradeapoioq==");
$submit_vars['__EVENTVALIDATION']=urldecode("/addafadfaerttq/aa/yqea");
$submit_vars['ctl00$ContentPlaceHolder1$lstc']="1";
$submit_vars['ctl00$ContentPlaceHolder1$lstm']="11";
$submit_vars['ctl00$ContentPlaceHolder1$lstce']="16";
$submit_vars['ctl00$ContentPlaceHolder1$lstt']="18289";
$submit_vars['ctl00$ContentPlaceHolder1$btnSad']="Submit";

$submit_url = "http://www.URL.com/Default.aspx";

$snoopy->submit($submit_url,$submit_vars);

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文