Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: login

  1. #1
    Regular Coder
    Join Date
    Nov 2006
    Posts
    601
    Thanks
    1
    Thanked 2 Times in 2 Posts

    login

    hey hey guys...ok i got a login script on anouther page of my site... but i wanna put it on my home page and then make it so my forum and other stuff are all done via the login page...at the moment i have this script on one of the pages

    Code:
    // File ID: login.php (user log in routine)
    
    include("require/config.php");
    require("$reqpath/common.php");
    require("$reqpath/membership.php");
    
    $content="$incpath/login.inc.php";
    $menu="$incpath/menu_u.inc.php";
    $page_title="Login Form";
    $button=array("Login");
    $action="login.php";
    
    if ($HTTP_POST_VARS) {
      if ($login && $password) {
    	$password=crypt($password, $login);
    	$data=authenticate($login, $password);
    	if ($data[error]) {$error=$data[error];}
    	else {
    		setcookie("ProfilePage","$login&&$password", 0, "/");
    		if (!$ref) {$ref="index.php";}
    		Header("Location: redirect.php?redirect=$ref");
    	}
      } else {$error="80";}
    }
    
    error_message($error);
    
    include("$incpath/header.inc.php");
    include("$incpath/body.inc.php");
    include("$incpath/right.inc.php");
    include("$incpath/footer.inc.php");
    wat will i have to do to it to make it so that
    A. IT LOGS USERS IN (think obviusly i will need to change the paths to profiles/require/config.php because thats what folder they are in.

    B. make it so that the user stays logged in and can view the whole site!!

    can any 1 help?

  • #2
    Regular Coder Tyree's Avatar
    Join Date
    Sep 2003
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you have a forum like vbulletin, you'll have to get into setting up a cookie that vbulletin also uses and check against that cookie for each page to insure the user is logged in.

    Check out the vbulletin (or other forum) code to see what the cookie is that it sets and set the same cookie from your main page login.

    That should do it...'course, I could just be an idiot too.


  •  

    Posting Permissions

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