J
James B
Guest
ok so if a user1 signed into his own page, he would have the url mysite.com/user1/index.php, but if he changes this to mysite.com/user2.index.php he can access user2's stuff. so i need a small code that will check a users username and if it dose not match a set username, redirect them to mysite.com/index.php. any help?
Thanks for the help but i came up with this solution
<?
session_start();
if(!session_is_registered(myusername)){
header("location:index.php");
}
if ($_SESSION['myusername']=="username here")
echo "";
else
header("location:some page");
?>
Thanks for the help but i came up with this solution
<?
session_start();
if(!session_is_registered(myusername)){
header("location:index.php");
}
if ($_SESSION['myusername']=="username here")
echo "";
else
header("location:some page");
?>