Forum Moderators: open

Message Too Old, No Replies

Login through a link - possible?

         

biggen12002

4:04 am on Dec 13, 2008 (gmt 0)

10+ Year Member



So I haven't found answers to this question anywhere, and I was wondering if anyone could help.

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]

willybfriendly

4:33 am on Dec 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A couple of different ways, but this will open up major security holes.

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.

biggen12002

4:55 am on Dec 13, 2008 (gmt 0)

10+ Year Member



Thanks for the quick answer! The thing is, it's not my website, so I can't change any of the coding. Sorry I am very new to all of this. Thanks for the answer

daveVk

6:16 am on Dec 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am trying to make a program that logs onto this game

You don't say what language you are programing in, you can't do it with a simple link, many languages support post including AJAX in javascript.

biggen12002

3:50 pm on Dec 13, 2008 (gmt 0)

10+ Year Member



Thanks for the answer dave. Well I really only know VB, which probably isn't going to help me much here. But are you talking along the lines of something like a XMLHttpRequest?

daveVk

12:26 am on Dec 14, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes thats it, think VB supports XMLHttpRequest, good luck.

g1smd

12:23 am on Dec 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Err,
username:password@www.example.com
works for very many sites, but is a huge security risk to you as there are so many ways that other people can get that user name and password.