So i created a Social Networking site for the students at my school but im like having a problem...so when they log out everythings all good..the sessions get destoyed and yay no problems...when you go back to the site you cant login cause there is no session set...BUT... when i go the My Account part of the website that checks to see the user account type (admin, student etc.) but for somereason if I log out and then log back in as someone else my account information is still there but only on that one page........AHHHH...its getting me so upset!! heres some code...
destroy session
<?
//This code destroys the session meaning you can no longer access member only areas.
session_start();
session_destroy();
unset($_SESSION['myusername']);
if(!isset($_SESSION['myusername'])){
echo "Logout Successful!";
}else{
echo "Logout Failed.";
}
?>
My Account
No HTML just the hardcore php stuff
<?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.
}
?>
<?php
include("../housekeeping/dbconnect.php");
$username=$_SESSION["myusername"];
//This selects the message where it has not been read alread, thats why it only pick
$sql ="SELECT * FROM `SocInt`.`members` WHERE `username`='$username'";
?>
why is is it on only THIS page it stays the same....i dnt get it....