tags:

views:

126

answers:

3

Hi,

Could anyone tell the logic/code for the following scenario.

Suppose we are given the username and password (obtained through some method).now we should append the username and password to the querystring(using GET method), send the values to the server (get the user validated), and then he is sent/redirected to a php webpage(this page has user specific data).

All this should be done using php(ajax maybe included if necessary).I donot want to use a separate login page.

Any help is greatly appreciated.

A: 

Are you looking to do something like this: http://roshanbh.com.np/2008/04/ajax-login-validation-php-jquery.html ?

Kentor
i needed to bypass the login system.the variables are got through other ways.i just have to append them using get method.do server side processing using php.
swathi
Like Zack said, you should not put the username/password in the url (GET) but if you still want to do that, then you can append them to the URL and then retrieve them and process them as you wish (here's how to use $_GET -> http://www.w3schools.com/PHP/php_get.asp )
Kentor
btw, if you are going to put login/passwords into $_GET, I would recommend encrypting them using md5 or something similar.
Kentor
A: 

you should never send usernames and passwords using GET. This should always be done using POST.

As for accessing them on the serverSide, call $_REQUEST['userName'] and $_REQUEST['password']

Zack
zack.the users are already in page 1 of a secure system.but they need to goto another page-say page 2(which is part of another system).right now inorder to reach page2 they need to enter the username and password(which is in an intermediary page).but i want to bypass that intermediary.
swathi
A: 

Check out this working example

Phill Pafford