Results 1 to 2 of 2

Thread: PHP login script

  1. #1
    Join Date
    Dec 2009
    Posts
    54
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Question PHP login script

    Hi guys,

    im new at php and would like to know if there is any tutorial to a free php script/code that allows different users to login to different places.

    e.g:
    u: user1 - p: pass1 > 1.html
    u: user2 - p: pass2 > 2.html
    u: user3 - p: pass3 > 3.html
    u: user4 - p: pass4 > 4.html

    i have looked on google but all i can fiind are ones that handle mutiple user login but all go to the same page

    Thanks in advance

  2. #2
    Join Date
    Mar 2011
    Location
    N 11 19' 0.0012 E 142 15' 0
    Posts
    1,590
    Thanks
    57
    Thanked 99 Times in 97 Posts
    Blog Entries
    4

    Default

    Just use a normal login script and then adapt it.

    You could make a new field in the username table of a database (SQL) and store in it the name of the page you would like to assosiate (how do you spell that???) with that user. Then after their login has been validated you could use something like this

    PHP Code:
    $usename = (their username);
    $check mysql_query("SELECT * FROM table WHERE username = '$username'")or die(mysql_error());
    $info mysql_fetch_array($check); 
    $page $info['fieldname'];
    header("Location: $page"); 
    Posting Tips + FAQ | Issues? Feel free to PM me
    - keyboard1333[at]gmail[dot]com

Tags for this Thread

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
  •