Can Anyone Fix This Code? Its My First Time Converting A Header
Can Anyone Help Fix The Bug In This?
<?php
class headers {
function startheaders() {
$key = substr($key = basename($_SERVER['PHP_SELF']), 0, strpos($key, "."));
$page = isset($table[$key]) ? $table[$key] : " ";
global $ir, $set;
echo <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{$set['game_name']}</title>
<link rel="shortcut icon" href="icon.png">
<style type="text/css">
<!--
body {
margin: 0;
padding: 0;
background: #000000;
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
color: silver;
}
h1, h2, h3 {
margin-top: 0;
}
a {
text-decoration: none;
color: red;
}
a:hover {
color: blue;
--->
</style></head>
<body>
<center>
<table width="970" border="0" cellpadding="0" cellspacing="0" class="table2">
<tr>
<td class="lgrad"></td>
<td class="center">
EOF;
}
function userdata($ir,$lv,$fm,$cm,$dosessh=1)
{
global $db,$c,$userid, $set;
$IP = ($_SERVER['HTTP_X_FORWARDED_FOR'])
? $_SERVER['HTTP_X_FORWARDED_FOR']
: $_SERVER['REMOTE_ADDR'];
$db->query("UPDATE users SET laston=unix_timestamp(),lastip='$IP' WHERE userid=$userid");
if(!$ir['email'])
{
global $domain;
die ("<body>Your Account May Be Broken. Please Contact Your E-Mail Stating Your Username And User ID.");
}
if($dosessh && ($_SESSION['attacking'] || $ir['attacking']))
{
print "You Lost All Your EXP For Running From A Fight Like A Coward.";
$db->query("UPDATE users SET exp=0,attacking=0 WHERE userid=$userid");
$_SESSION['attacking']=0;
}
$enperc=(int) ($ir['energy']/$ir['maxenergy']*100);
$wiperc=(int) ($ir['will']/$ir['maxwill']*100);
$experc=(int) ( $ir['exp']/$ir['exp_needed']*100);
$brperc=(int) ($ir['brave']/$ir['maxbrave']*100);
$hpperc=(int) ($ir['hp']/$ir['maxhp']*100);
$enopp=100-$enperc;
$wiopp=100-$wiperc;
$exopp=100-$experc;
$bropp=100-$brperc;
$hpopp=100-$hpperc;
$d="";
global $staffpage;
$bgcolor = '000000';
$fbm=Respect_formatter($ir['bankRespect']);
$fcm=Respect_formatter($ir['cyberRespect']);
$d="";
$u=$ir['username'];
if($ir['donatordays']) { $u = "<font color=gold>{$ir['username']}</font>";$d="[img=donator.gif]"; }
$gn="";
global $staffpage;
$bgcolor = '000000';
print <<<OUT
[img=title.jpg]
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" bgcolor="#$bgcolor" valign="top">
[b]Name:[/b] $gn{$u} [{$ir['userid']}] $d
[b]Money:[/b] {$fm}
[b]Level:[/b] {$ir['level']}
[b]Crystals:[/b] {$ir['crystals']}
[[url='logout.php']Emergency Logout[/url]]
<hr />
[b]Energy:[/b] {$enperc}%
<img src=greenbar.png width=$enperc height=10><img src=redbar.png width=$enopp height=10>
[b]Will:[/b] {$wiperc}%
<img src=bluebar.png width=$wiperc height=10><img src=redbar.png width=$wiopp height=10>
[b]Brave:[/b] {$ir['brave']}/{$ir['maxbrave']}
<img src=yellowbar.png width=$brperc height=10><img src=redbar.png width=$bropp height=10>
[b]EXP:[/b] {$experc}%
<img src=bluebar.png width=$experc height=10><img src=redbar.png width=$exopp height=10>
[b]Health:[/b] {$hpperc}%
<img src=greenbar.png width=$hpperc height=10><img src=redbar.png width=$hpopp height=10>
<hr />
OUT;
$php_self=$_SERVER['PHP_SELF'];
$closedpage=$db->query("SELECT * FROM `closedpages` WHERE page='$php_self'");
$cp=$db->fetch_row($closedpage);
if(!$cp['page']) {
$db->query("INSERT INTO `closedpages` VALUES ('$php_self', 0)");
print "[b]PAGE ADDED TO THE CLOSED PAGES LIST[/b]";
}
if ($cp['closed'] == 1)
{
die ("[b]<center><font color=red>This Page is not open to the Public Over Maintenance</font>
[url='index.php']Go Home[/url][/b]</center>");
}
if($ir['fedjail'])
{
$q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid");
$r=$db->fetch_row($q);
die("[b]<font color=red size=+1>You have been put in the {$set['game_name']} Federal Jail for {$r['fed_days']} day(s).
Reason: {$r['fed_reason']}</font>[/b]</body></html>");
}
if(file_exists('ipbans/'.$IP))
{
die("[b]<font color=red size=+1>Your IP has been banned from {$set['game_name']}, there is no way around this.</font>[/b]</body></html>");
}
}
function menuarea()
{
include "mainmenu.php";
global $ir,$c;
$bgcolor = '000000';
print '</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"></td><td width="80%" bgcolor="#'.$bgcolor.'" valign="top">
<center>';
if($ir['hospital'])
{
print "[b]NB:[/b] You are currently in hospital for {$ir['hospital']} minutes.
";
}
if($ir['jail'])
{
print "[b]NB:[/b] You are currently in jail for {$ir['jail']} minutes.
";
}
print "[url='donator.php'][b]<font color='red'>Donate to {$set['game_name']} now for game benefits!</font>[/url]
[url='voting.php']<font color=blue>Vote for {$set['game_name']} and get rewarded!</font>[/url][b]";
}
function smenuarea()
{
include "smenu.php";
global $ir,$c;
$bgcolor = '000000';
print '</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"></td><td width="80%" bgcolor="#'.$bgcolor.'" valign="top"><center>';
}
function endpage()
{
global $db;
print <<<OUT
</center>
</td>
</tr>
</table></td>
<td class="rgrad"></td>
</tr>
<tr>
<td colspan="3">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="dgradl"></td>
<td class="dgrad"></td>
<td class="dgradr"></td>
</tr>
</table>
</td>
</tr>
</table>
{$db->num_queries} queries</body>
</html>
OUT;
}
}
?>