...

View Full Version : Submitting Parameters via URL



tsidell
03-03-2009, 05:20 PM
Okay, so I know how to pass in parameters to the URL for instance at http://oit.nyls.edu/digitalcommons I can use http://oit.nyls.edu/digitalcommons/index.php?uName=username&uPassword=password. But I am wondering in this case how do I get it to automatically submit those parameters via the URL. Like i want it to automatically login the user in based on their credentials without showing them that actual screen.

Any help would be appreciate as I have been stuck for a while.

kokjj87
03-03-2009, 06:28 PM
Do you mean not showing the credentials on the url?

If it is.....

You need to use POST and it will not show up in the url

Html

<form method="post" action="action.php">
<!-- form content -->
Username:
<input type="text" name="username"/>
Password:
<input type="password" name="password"/>
<input type="submit" name="Login"/>
</form>

php page:

<?php
echo $_POST['username'];
echo $_POST['password'];
?>

tsidell
03-03-2009, 06:47 PM
Not exactly. I have it so that it throws the username and the password in the form. For instance if I type in http://oit.nyls.edu/digitalcommons/index.php?uName=username&uPassword=password it throws username under the field Username and password under the field "Password". it doesnt perform the action and submit the form.

tsidell
03-03-2009, 06:50 PM
I just want it to submit the form automatically after I pass in the username and password from the URL

Fou-Lu
03-03-2009, 07:19 PM
You'll want to use cookies for this instead.
Then you need to alter you're authentication handling to check for the existance of the cookies, validate them, and automatically log the user in. There is no way in PHP to force a submit from a browser.

eu4ria
03-03-2009, 10:51 PM
If you are a URL that you are creating with the username/password in it, why send it to the login form. You could simply send it to the form that the login sends its data to and have it read the data from the URL. This is not as secure because you are passing the password in the URL, but depending on what you are doing it may work.

You may just need to change our form proccessing so as not to check for a posted form, because it wont have been posted. You could instead check to see if both username and password have a value.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum