I have a custom template that when the word die is used it cancels the footer and I get a half a page. How do I change this code with out the word die? I have tried using this exit($h->endpage()); in place of die but it still does not work. Trying to learn this stuff but it is slow going. Here is the complete code. If I can see it done I can fix all my pages. Thanks in advance.
<?php
include_once "globals.php";
if($ir['jail']) { die("<h2>Your in Jail!</h2>Come back in {$ir['jail']} Minutes!"); }
if($ir['hospital']) { die("<h2>Your in Hospital</h2>Come back in {$ir['hospital']} Minutes!"); }
if($ir['donatordays'] == 0)
{
die("Sorry, This Feature is for Donators only!");
}
print "<br /><center><table width=80% class=h border=1><tr><th>Daily Donator Reward</th></tr><tr>
<td>
<center><hr width='70%'>This Feature is For Donators Only,<br /> You only have 1 Chance (Each Day) to get a Reward,<br /> The Rewards will be Different Each Day of the Week!<hr width='70%'><br />";
if($_GET['reward'])
{
if($ir['reward_done'] >= 1)
{
die("<font color=red>Sorry, You Have already Had your Daily Donator Reward, Come Back Tomorrow!</font><br><br>
</td></tr></th></table><table width=80% class=h border=1><tr><th><a href='ddreward.php'>- Go Back -</a></th></tr></td></th><br /></table>");
}
$num=rand(1, 5);
$db->query("UPDATE users SET reward_done=reward_done+1 WHERE userid=$userid");
$ir['money']-=100;
switch($num)
{
case 1:
$money=rand(30, 1200);
print "<font color=green>You Have Been Rewarded Money!</font>";
$db->query("UPDATE users SET money=money+{$money} WHERE userid={$userid}");
break;
case 2:
print "<font color=green>You Gained Some Brave!</font>";
$db->query("UPDATE users SET brave=maxbrave WHERE userid={$userid}");
break;
case 3:
print "<font color=green>You Gained Some Will!</font>";
$db->query("UPDATE users SET will=maxwill WHERE userid={$userid}");
break;
case 4:
print "<font color=green>You Gained Some Energy!</font>";
$db->query("UPDATE users SET energy = energy +5 WHERE userid={$userid}");
break;
case 5:
print "<font color=green>You Gained 10 Crystals!</font>";
$db->query("UPDATE users SET crystals = crystals + 10 WHERE userid={$userid}");
break;
}
print "<br /><br />
<a href='index.php'><font color=black>- back -</font><br />
<br />";
}
else
{
print "
<br /></td></tr></th></table><table width=80% class=h border=1><tr><th><a href='ddreward.php?reward=1'><font color=green>- Start -</font></a></th></tr></td></th><br /></table>
<br><table width=80% class=h border=1><tr><th><a href='index.php'>- Go To Home -</a></th></tr></td></th></table><br />";
}
$h->endpage();
?>