ok so here is the code:
[php]<?php
session_start(); // Must start session first thing
/*
Created By Adam Khoury @ www.flashbuilding.com
-----------------------June 20, 2008-----------------------
*/
// Here we run a login check
include_once “connect.php”;
// Place Session variable ‘id’ into local variable
$sql = mysql_query(“SELECT * FROM cart”);
while($row = mysql_fetch_array($sql)){
$cid = $row[“cart_id”];
$academy = $row[“academy”];
$complete = “”.$cid."".$academy."";
$_SESSION[‘complete’] = $complete;
$_SESSION[‘cart_id’] = $cid;
$_SESSION[‘academy’] = $academy;
}
if (!isset($_SESSION[‘complete’])) {
echo ‘Please log in to access your account’;
exit();
}
//Connect to the database through our include
include_once “connect.php”;
// Place Session variable ‘id’ into local variable
$academy = $_SESSION[‘academy’];
$sql = mysql_query(“SELECT * FROM cart”);
while($row = mysql_fetch_array($sql)){
$cid = $row[“cart_id”];
$_SESSION[‘cart_id’] = $cid;
}
echo $cid;
echo “
”;
echo $academy;
?>
[/php]
what I need to know how to do is arrange my code so that if the person is logged in already, the part before the if isnot set, will run. but if the person is not already logged in, they must login first. the problem is if one person is logged in, all people can get logged in. please help…