!!! Session Refresh Update !!!
Posted: Sat Aug 14, 2010 9:29 am
Hey guys.
I saw people asking or well telling that the login redirection thing well it is a bugger, and they asked if it was possible to make it auto redirect to the login instead of clicking a link...
Well people here it is:
Have Fun.
I saw people asking or well telling that the login redirection thing well it is a bugger, and they asked if it was possible to make it auto redirect to the login instead of clicking a link...
Well people here it is:
Code: Select all
<?php
if (isset($_SESSION['player']))
{
$player=$_SESSION['player'];
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("Could not get user stats");
$playerinfo3=mysql_fetch_array($playerinfo2);
echo "<input type='hidden' name='id' value='$playerinfo3[id]'>";
$updaterefresh="update players set lastattacked=0 where ID='$playerinfo3[id]'";
mysql_query($updaterefresh) or die("Died");
}
else
{
echo "Sorry, not logged in, please wait you will be redirected to the appropriate place in 5 seconds <meta http-equiv='refresh' content='5;url=../forsaken1/login.php'>";
echo "<br>";
echo "If you are not being redirected within 5 seconds, please click <a href='../forsaken1/login.php'>HERE</a> to go there manually";
exit;
}
$currentbar = ($playerinfo3['stamina']/$playerinfo3['maxstamina']) * 100;
$healthbar = ($playerinfo3['hp']/$playerinfo3['maxhp']) * 100;
?>