...

View Full Version : login



runnerjp
11-30-2006, 09:59 AM
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


// 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?

Tyree
11-30-2006, 02:50 PM
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. ;)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum