April 11, 2011

login through script to any website

Question by RAJESH BANSAL

I have username and passwords in database table for many websites. Whenever I need to go through the website I have to copy and paste usernames and passwords to login. Which is very time consuming.

So I need a php script by which I only need to click the link of website which I need to login and by using username and password from database, it automatically submit login form and redirect me to after login web page.

I hope you understand my need.

Answer by Starx

I am not sure of what is being asked here. FTP Password and CPanel Password are not possible to be logged in through your script. But for admin panel, it is possible (not that I am encouraging it), using a hidden form.

<form name="hiddenform1" action="http://thetargetwebsite.com/login.php" method="post">
    <input name="user" id="user" type="hidden" value="theusername" />
    <input name="password" id="password" type="hidden" value="thesecretpassword" />
    <a href="#" onClick="document.forms["hiddenform1"].submit();">The almightly link</a>
    <!-- Or modify the submit button to make it look like a link -->
</form>

After, this the targetted website, will use the username and password sent by your form to login.

...

Please fill the form - I will response as fast as I can!