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