SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru dwzemens's Avatar
    Join Date
    Mar 2005
    Location
    United States
    Posts
    768
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Login to secondary site <Form> from primary site <Form>

    Hello again,

    I have a client who wants their site users to be able to login to a third party website (with whom my client has a relationship, all legitimate). My client wants the users to "login" on their site, and then have the FORM submit to the secondary site, and submit from that site just as if the user had gone there and typed in their name and password. Make sense? How difficult is it to accomplish?

    Thanks!
    Web Design, Marketing, Etc .............
    ....

  2. #2
    CTO htmlguy's Avatar
    Join Date
    Feb 2005
    Location
    North Carolina
    Posts
    420
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is php, and second of all, I think it is pretty easy (if I am thinking right). Have it so the last line of the php code <?php ?> is like the following
    Code:
    header.location( "http://www.thissite.com/login.php?user=" . $_POST[username] . "&pass=" . $_POST[password] . "&ref=0000" )
    I'm not quite sure if this will work (the header.location needs to be changed to something), but that would be my best guess, or something similar.
    HTMLGuy

  3. #3
    SitePoint Member
    Join Date
    Jul 2005
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    header.location( "http://www.thissite.com/login.php?user=" . $_POST[username] . "&pass=" . $_POST[password] . "&ref=0000" )
    That isn't good coding to have the password displaying in the URL.

    All you need to do is. Display the login box on the primary site then set the form action to the secondary site, i.e
    Code:
    <form action="http://www.secondary-site.com/login-script.php">
    So when the click the submit button it will login at the secondary site then just use some simple javascript to to them back to the primary site. If your more advanced, i think you can use AJAX to login at the secondary site with out refreshing the page!

  4. #4
    CTO htmlguy's Avatar
    Join Date
    Feb 2005
    Location
    North Carolina
    Posts
    420
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why didn't I think of that! That's exactly what you should do, I was overthinking myself with trying to tell you a language that I am not very good at (that's why the name isn't phpguy).
    HTMLGuy


Bookmarks

Posting Permissions

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