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..
session problem?
Moderator: General Moderators
i included the session_start() to the header.inc file then all pages are includeing the header.inc
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
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">