Forum Moderators: open
Is there anyway to login on a website through a link, instead of actually logging in and hitting the submit button. I am trying to make a program that logs onto this game I play online, and I can't figure out how to log in with my program.
I am thinking something along the lines of http://www.example.com/login.php?action=login&username=myid&password=mypassword or something similar. Is that possible? Here is the view source of the page I am looking at:
<table class='loginInput'>
<caption><b>Login</b></caption>
<tr><td>
<form action='authenticate.php' method='post' name='login' onsubmit='return saveme();'>Username:
<input type='text' name='username' /><br />
Password: <input type='password' name='password' /><br />
Remember me?<br />
<input type='radio' name='save' value='1' />Yes
<input type='radio' name='save' value='0' />No
<input type='submit' class='theButton' value='Submit' />
</form>
</td></tr>
</table>
So is what I am looking for possible? Or does the method 'post' make it impossible? Any help would be MUCH appreciated. Thanks in advance
[edited by: tedster at 6:15 am (utc) on Dec. 13, 2008]
[edit reason] switch to example.com - it can nevern be owned [/edit]
1. In your form handler script, change $_POST to $_GET. It will then use the variables appended to the URL
2. Put up a new page. Write a short script something like
$_POST[username] = $_GET[username];
$_POST[password] = $_GET[password];
header('Location: http://www.example.com/athenticate.php');
For an introduction to php superglobals, see [us.php.net...]
The GET and POST methods are entirely different and must be handled as such in any script that accesses them.