0

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?

user3332631
  • 334
  • 1
  • 3
  • 11

2 Answers2

1

try this instead document.getElementById("ctl00_ContentPlaceHolder1_nativeLoginButton").click()

dariogriffo
  • 4,148
  • 3
  • 17
  • 34
  • You should also check if is not null if they change that, take a look at the class and use document.getelementbyclass if the first is null before the click – dariogriffo Sep 01 '14 at 14:58
0

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.

Community
  • 1
  • 1
MeanGreen
  • 3,098
  • 5
  • 37
  • 63
  • Also relevant, but this was not my problem. Especially since i could sumit the form manually from my domain and it worked fine. – user3332631 Sep 01 '14 at 14:58