-
Login redirect
I am thinking of this functionality how it will be coded.
Scene:
Two input text boxes and submit button.
User:
User will enter username and password and click submit
What i need:
I want to transfer the entered username and password to another website's(site1) username and password box.
And redirect my user to login account (after submission of username/password) of site1 website.
I think dom can solve my problem but not sure.
Your help is appreciated.
Thank You.
-
Re: Login redirect
You would be better off using Javascript. I have created a function which enablesyou to create a hidden form and submit it to another site using either POST or GET. Have a look here:
http://phpbuilder.com/board/showpost...53&postcount=2
-
Re: Login redirect
It is good example but then i want to get html of that page (after redirection and submission) . :)
-
Re: Login redirect
You will have to make the request from your PHP script. The curl extension enables you achieve this.
PHP Code:
$postVars = 'username=' . urlencode($username);
$postVars .= '&password=' . urlencode($password);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://www.thesite.com/thepage.php');
curl_setopt($curl, CURLOPT_POST, 1); // make it a post request
curl_setopt($curl, CURLOPT_POSTFIELDS, $postVars); // add the post variables
$output = curl_exec($curl); // the response arrives here
curl_close($curl);