Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simulate ASP Post

Status
Not open for further replies.

kmalhotra

IS-IT--Management
Feb 20, 2003
6
US
I am making a program similar to the one used by say banks when they allow us to save our username and passwords for say different websites and when we click on the link, logs us in automatically.

I have created an ASP page, which allows me to post to another ASP page with the fields, that the other ASP page requires. So once I know the URL, login name and password of a site, I can pass it to my ASP page and make it post to that particular page and it works.

Some sites use JavaScript to redirect to other pages. I am having a hard time simulating that.

For example instead of submitting a page directly, I could call a JavaScript function on click of the submit button and that will in turn redirect us to another page.

I need help

Thank You
Kunal Malhotra
 
Not sure I fully understand, but you can use the .submit() function in javascript to submit a form like so:
Code:
<html>
<body>
<form method=&quot;POST&quot; action=&quot;wherever.asp&quot; name=&quot;frmLogin&quot;>
<input type=&quot;text&quot; name=&quot;username&quot;><br>
<input type=&quot;text&quot; name=&quot;password&quot;><br>
<a href=&quot;#&quot; onCLick=&quot;frmLogin.submit();&quot;>Submit</a>
</form>

I'm not sure that is what your looking for though, could you possibly post a link to a site that does this as an example?

-Tarwn ________________________________________________
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Tarwn,

Thanks for responding. What I am looking to do is automate the user login on to another website. For example

1)Go the the login page of a site - My page posts to the remote page and also posts the form fields.


where txtLogin is the form element for username and txtPassword is the form element for password. I already know the user name and the password.

This allows me to long into a site.

2) Now I want to go to page1.asp and then want my program to automatically fill in a field say txtUserid=33 and submit the form and then get the result.

The process flows like this user gives me the user name and password and the user id and then clicks on my submit button and I in turn do steps 1 and 2 and bring him directly to the record of user 33.

My problem is that my program can handle ASP submit but say if the website were to have a javascript function on the page1.asp. This page would call the function on clicking submit and would redirect me to the user record page. Now since the page has not been submitted, I can not do anything.


I hope this has made it a bit more clear. Forgive me for leaving out the ssite name and other information.

Thank You
Kunal Malhotra
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top