Page 1 of 1

session problem?

Posted: Fri Mar 04, 2005 2:44 am
by pleigh
don't know if this is a session problem,...i have a login page so i can have full access to the web page, unfortunately, when any user tried to access, for example the index.php page without logging in, he can access the page but have errors in session for he does not provide anything to be authenticated.....my idea is to limit them from accessing other pages without logging in.....in my login page, i have declared session keys....so every page of my site has this code session_start()....how can i solve this problem?

thanks a lot..

Posted: Fri Mar 04, 2005 3:10 am
by JayBird
You'll need to show us your code

Posted: Fri Mar 04, 2005 3:20 am
by pleigh
i included the session_start() to the header.inc file then all pages are includeing the header.inc

Code: Select all

<?
session_start();
require_once ('dbconnect.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><? echo $pagetitle ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="templates/site.css" type="text/css">
</head>

<body bgcolor="#000000" topmargin="2" leftmargin="2" rightmargin="2" bottommargin="2">
<div align="center">
this is the header....i want to code somehting that prevents the user from going straight to the page if the user is not logged in

Posted: Fri Mar 04, 2005 7:53 am
by feyd
what are these "errors" ?