Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

After purchasing with us the download link will be delivered to your forum message box.


This forum is now closed and has moved to a new location! Click here to find out why.

AuthorTopic: Looking for some help  (Read 244 times)

mystical

  • Basic Member
  • *
  • Reputation Power: 66
  • mystical has no influence.
  • Offline Offline
  • Posts: 15
    • View Profile
Looking for some help
« on: June 09, 2011, 10:26:20 PM »
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.
Code: [Select]
<?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(15);
$db->query("UPDATE users SET reward_done=reward_done+1 WHERE userid=$userid");
$ir['money']-=100;
switch(
$num)
{
case 
1:
$money=rand(301200);
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();
?>
Logged

dominion

  • Active Member
  • **
  • Reputation Power: 89
  • dominion barely matters.dominion barely matters.
  • Offline Offline
  • Posts: 129
    • View Profile
    • Email
Re: Looking for some help
« Reply #1 on: June 10, 2011, 04:47:38 AM »
echo your error msg out, and the use die to call the footer.

echo "error";
die(
$h->endpage());
Logged

mystical

  • Basic Member
  • *
  • Reputation Power: 66
  • mystical has no influence.
  • Offline Offline
  • Posts: 15
    • View Profile
Re: Looking for some help
« Reply #2 on: June 10, 2011, 09:47:02 AM »
echo your error msg out, and the use die to call the footer.

echo "error";
die(
$h->endpage());


Thanks but you are talking to a total retard when it comes to this coding stuff. Where exactly do I put this echo "error";
die($h->endpage());
Tried a million places and I must be putting it in the wrong place because it still is missing half the page.
Logged

dominion

  • Active Member
  • **
  • Reputation Power: 89
  • dominion barely matters.dominion barely matters.
  • Offline Offline
  • Posts: 129
    • View Profile
    • Email
Re: Looking for some help
« Reply #3 on: June 11, 2011, 05:16:41 AM »
Well no. including the footer won't magically close every html tag. Are you just trying to keep the page html valid?
Logged

mystical

  • Basic Member
  • *
  • Reputation Power: 66
  • mystical has no influence.
  • Offline Offline
  • Posts: 15
    • View Profile
Re: Looking for some help
« Reply #4 on: June 11, 2011, 09:26:02 AM »
Fixed it. Thanks. Just had to redo it a little. Came out pretty good. Thanks again.
Logged
 


This forum is now closed and has moved to a new location! Click here to find out why.