We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,301 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

autofill a username and password

how can i autofill a username and password into a websiteB username nd password fields when i click a link present in websiteA.
The username and password vl b stord in a database. and when i click on the link referring to websiteB, present in websiteA , i shuld get automatically fill the usrname and password fields present in websiteB. can anybody giv idea how to write the script or code..

3
Contributors
2
Replies
3 Hours
Discussion Span
3 Years Ago
Last Updated
3
Views
vamshi099
Newbie Poster
1 post since Jul 2009
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

while you open yourself up to script kiddies/hacking, and highly NOT recommended that you do this....

when a user clicks the link, that should call a php script with GET parameters.

1 of the parameters should be a unique identifier.

That identifier should be stored in a table along with user names and passwords.

with SQL, select the username and password.

Set the values of the text and password boxes with the results returned from the database.

kireol
Posting Whiz
313 posts since Mar 2008
Reputation Points: 34
Solved Threads: 51
Skill Endorsements: 0

Why aren't you using cookies like a 'remember me' option?

If your DB is on website A, then you could spoof the login form on website B (change the text/password fields for hidden inputs with your username and password details - you have to ensure that name/id values are the same in both forms). **Check the site B source code for names/ids and any hidden inputs**. If you want to use a link as opposed to a submit button on website A. Change the submit button to a hidden field as well, keeping the name/id values. Then use a link with a javascript 'onclick' causing a 'submit' event.

As long as the website B login validation routine isn't checking your 'referer' details, you will be automatically logged into website B. If 'referer' is checked, there are ways around this by fiddling http requests (but that deserves a whole topic to itself).

I've used this before for connecting different websites BUT be aware that this is really unsafe - especially if website A isn't that secure - you'll probably need to beef up site A security.

diafol
Keep Smiling
Moderator
10,666 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,514
Skill Endorsements: 57

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0622 seconds using 2.67MB