使用 snoopy php 类在 ASPX 页面上提交表单 - 视图状态问题
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论