Code: Select all
<?php
$playerdead = $db->execute("SELECT p1.username as killedby, Time_Left FROM medical_ward m
INNER JOIN players p1 ON m.Killed_By_ID = p1.id
where playerdead_ID = $player->id");
$playerdead1= $playerdead->fetchrow();
if($playerdead1 [Time_Left] > 0)
{
echo "You were put in the hospital by " .$playerdead1[killedby] ."<p>";
echo "You have \n" . $playerdead1[Time_Left] . "\n Minutes remaining";
exit();
}
?>
On one forum, this was mentioned
Code: Select all
if($playerdead1 [Time_Left] > 0 && $PHP_SELF != 'inventory.php')
{
So I searched google, and was able to come up with this.
Code: Select all
if($playerdead1 [Time_Left] > 0 && $_SERVER['PHP_SELF'] != 'inventory.php')
Anyone have any suggestions on how to allow users, to access only the inventory.php page when they are in the hospital?
Thanks