Results 1 to 4 of 4

Thread: Login redirect

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    Osaka
    Posts
    200

    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.
    Last edited by slice; Feb 5th, 2006 at 08:10 AM.

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    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
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Location
    Osaka
    Posts
    200

    Re: Login redirect

    It is good example but then i want to get html of that page (after redirection and submission) .

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    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($curlCURLOPT_URL'http://www.thesite.com/thepage.php');
    curl_setopt($curlCURLOPT_POST1); // make it a post request
    curl_setopt($curlCURLOPT_POSTFIELDS$postVars); // add the post variables

    $output curl_exec($curl); // the response arrives here
    curl_close($curl); 
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width