简体   繁体   中英

ASP.NET auto submit problems

I am trying to logon users automaticly to an external site https://helpdesk.itslearning.com/Index.aspx

The idea is that I do the following steps:

  1. Retrieve the page with cURL in PHP
  2. Parse the HTML DOM and insert username and password
  3. Add document.getElementById("myForm").submit(); to the body onload
  4. echo the HTML and watch the magic

The problem is that this is not working. The form is submittet but the user is not logged in.

If I skip step 3. and press the submit button manually everyting works as intended. Any suggestions?

请尝试改用document.getElementById(“ ctl00_ContentPlaceHolder1_nativeLoginButton”)。click()

I think you need to look into cross domain posting, for example in this post: Asp.net Cross Domain Form Posting

By default it's not allowed to do things from one domain to the other, for security reasons.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM