PDA

View Full Version : asp.net url variables to populate form fields and/or auto submit



MISAckimball
11-12-2010, 10:13 AM
I have a shortcut on my desktop to a login page for a website I use quite often. Every time I go there I have to reenter my user name and password.

The desktop URL shortcut I have is

http://domain.com/service/Login.aspx

I’ve tried adding the following changes

http://domain.com/service/Login.aspx?username=ckimball&password=joshua1

But this doesn’t auto populate the fields on the website when it loads. Is there something special I need to do so the webpage will fill in the fields on the form?

Also bonus if I could just auto submit to login so I don’t need the page to load and have me click “login” but I don’t think that’s possible… or is it?

Any help is greatly appreciated.

Chris
11-13-2010, 08:38 AM
This depends on the programming of the website in question. It would be possible for the website to be programmed in such a way to allow you to automatically enter your login information via the URL as you have tried, but it doesn't sound like this website is programmed for that. Assuming you have the right variable names (they aren't always literally "username" and "password").

The one thing you could do is make an HTML page stored locally on your computer and include a copy of the HTML form from your target website and then, in the copy on your company, prepopulate the form as desired.



<form method = "post" action = "the-target-url-from-the-website">
<input type = "text" name = "username" value = "ckimball">
<input type = "text" name = "password" value = "joshua1">
<input type = "submit" name = "submit" value = "Submit">
</form>


Even this might not work. They may have a hidden form field variable (you could see that in the source code though) or might check session information for the HTTP_REFERER which needs to match their site.