Ok so i built a members only website for my school. Well it works all fine and dandy but when i would sign in as one person, then sign out, then sign in again as a different person, the session for the other person is still active... EX
user a --sign in...blah...signout....
User b (on same computer) signs in..User A's information is there. BUT ONLY on the home page and on every other page it has all of his info just perfect...
heres some of the code for my home page...
<?php
//This code checks to make sure they are logged in BEFORE they can access the webpage
session_start();
if(!isset($_SESSION['myusername'])){
//If he is not logged in, go to index.php
header("location:/si/index.php");
}else{
//If he is logged in do nothing and go on to the rest of the code.
}
-------------------------------------A Way After the HTML----------------
<?php
include("housekeeping/dbconnect.php");
$username=$_SESSION["myusername"];
$sql ="SELECT * FROM `SocInt`.`members` WHERE `username`='$username'";
$result=mysql_query($sql);
if($row = mysql_fetch_array($result)){
$id=$row[id];
}
echo $id;
echo "Personal Profile:<a href=\"http://www.onikz.com/si/me/myProfile.php?id=$id\">View</a>-<a href=\"http://www.onikz.com/si/me/editPersonalProfile.php\">Edit</a>| ";
echo " <a href=\"#\">Scholar Profile</a> | ";
echo " <a href=\"#\">My Acount</a> | ";
echo " <a href=\"#\">Settings</a> ";
?>
?>
so basically thats the only places where the Username information comes up...