Jump to content
MakeWebGames

Header.php error


Ben Nash

Recommended Posts

I keep getting this error:

Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /home/warfarei/public_html/trying/header.php on line 222

when i try to integrate mccodes into my xhtml file.

 

<?php

class headers {
function startheaders() {
global $ir, $set;
echo <<<EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Nerf Warrriors</title>
<style type="text/css">

body {
   background-image: url(Images/bg.jpg);
}

#wrap {
  	background-color: #dfdac6;
width:800px;
margin-left:auto;
margin-right:auto;
border-style: solid;
border-width: 1px;
border-color:#eeeeee;
}

#top {
  background-image: url(Images_Ingame/headerbg.jpg);
  background-repeat:no-repeat;
   width: auto;
height:100px;
}


#bar {
  background-image: url(Images_Ingame/menubg.jpg);
  font-family: arial;
  font-size: 11px;
  margin-top: auto;
  width:100%;
  height: 57px;
}


.menulinks {
  list-style-type:none;
  margin:auto;
}

.menulinks li {
 display:inline-block;
 margin-left:5px;
 margin-top:12px;
}



#nav {
  float:left;
  height:600px;
  width:250px;
  background-image: url('Images_Ingame/navbg.jpg');
  background-repeat:-y;
  padding-right:40px;
  padding-top:15px;
}

#content {
  height:615px;
  text-align:center;
  width:auto;
  background-image: url('Images_Ingame/contentbg.jpg');
  background-repeat:-x;
  margin-left:250px;
}



.nav2 {
  list-style-type:none;
  margin:0px;
}


.nav2 li {
  display:block;
  background-image:url('Images_Ingame/link.jpg');
  width:210px;
  height:20px;
  padding:3px;
  text-align:center;
}

a:link {
  color:#000;
  text-decoration:none;
}

a:hover {
  text-decoration:underline;
}

a:visited {
  color:#000;
  text-decoration:none;
}

img {
  border:none;
}

.info {
  padding-left:5px;
}

#footer {
   clear:both;
   background-image: url('Images/footer.jpg');
height:40px;
padding-top:5px; 
padding-right:15px;
text-align:right;
}
</style>
</head>
<body>
EOF;
}
function userdata($ir,$lv,$fm,$cm,$dosessh=1)
{
global $db,$c,$userid, $set;
$IP = $db->escape($_SERVER['REMOTE_ADDR']);
$db->query("UPDATE `users` SET `laston` = ".$_SERVER['REQUEST_TIME'].",`lastip` = '$IP' WHERE `userid` = $userid");
if(!$ir['email'])
{
global $domain;
die ("<body>Your account may be broken. Please mail help@{$domain} stating your username and player ID.");
}
if($dosessh && ($_SESSION['attacking'] || $ir['attacking']))
{
echo "You lost all your EXP for running from the fight.";
$db->query("UPDATE users SET exp=0,attacking=0 WHERE userid=$userid");
$_SESSION['attacking']=0;
}

$d="";
$u=$ir['username'];
if($ir['donatordays']) { $u = "<font color=red>{$ir['username']}</font>";$d="<img src='donator.gif' alt='Donator: {$ir['donatordays']} Days Left' title='Donator: {$ir['donatordays']} Days Left' />"; }

$gn=""; 
global $staffpage;


print <<<OUT
<div id="wrap">

<div id="top"></div>

<div id="bar">
<ul class='menulinks'>
<li><a href='#'><img src='Images_Ingame/homepage.jpg'></a></li>
<li><a href='#'><img src='Images_Ingame/messages.jpg'></a></li>
<li><a href='#'><img src='Images_Ingame/usersonline.jpg'></a></li>
<li><a href='#'><img src='Images_Ingame/vote.jpg'></a></li>
<li><a href='#'><img src='Images_Ingame/donate.jpg'></a></li>
</ul>
</div>


<div id="nav">

<ul class="nav2">
<b>Name:</b> $gn{$u} [{$ir['userid']}] $d<br />
<b>Money:</b> {$fm}<br />
<b>Level:</b> {$ir['level']}<br />
<b>Points:</b> {$ir['points']}<br />

OUT;
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).<br />
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() {
define('jdsf45tji', true, true);
	include 'mainmenu.php';
global $ir,$c;



function smenuarea() {
define('jdsf45tji', true, true);
	include 'smenu.php';
global $ir,$c;


}
function endpage()
{
global $db;
print <<<OUT


<div id="content">welcome</div>

<div id="footer">Copyright stuff</div>
</div>
</div>
</body>
</html>
OUT;
}
}
?>

 

Can someone please fix this code...

NOTE: i don't need the energy, will bars and jail and hospital parts.

Thanks ben.

Edited by Ben Nash
Link to comment
Share on other sites

<?php
class headers {
function startheaders() {
global $ir, $set;
echo <<<EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Nerf Warrriors</title>
<style type="text/css">

body {
   background-image: url(Images/bg.jpg);
}

#wrap {
   background-color: #dfdac6;
   width:800px;
   margin-left:auto;
   margin-right:auto;
   border-style: solid;
   border-width: 1px;
   border-color:#eeeeee;
}

#top {
  background-image: url(Images_Ingame/headerbg.jpg);
  background-repeat:no-repeat;
   width: auto;
   height:100px;
}


#bar {
  background-image: url(Images_Ingame/menubg.jpg);
  font-family: arial;
  font-size: 11px;
  margin-top: auto;
  width:100%;
  height: 57px;
}


.menulinks {
  list-style-type:none;
  margin:auto;
}

.menulinks li {
 display:inline-block;
 margin-left:5px;
 margin-top:12px;
}



#nav {
  float:left;
  height:600px;
  width:250px;
  background-image: url('Images_Ingame/navbg.jpg');
  background-repeat:-y;
  padding-right:40px;
  padding-top:15px;
}

#content {
  height:615px;
  text-align:center;
  width:auto;
  background-image: url('Images_Ingame/contentbg.jpg');
  background-repeat:-x;
  margin-left:250px;
}



.nav2 {
  list-style-type:none;
  margin:0px;
}


.nav2 li {
  display:block;
  background-image:url('Images_Ingame/link.jpg');
  width:210px;
  height:20px;
  padding:3px;
  text-align:center;
}

a:link {
  color:#000;
  text-decoration:none;
}

a:hover {
  text-decoration:underline;
}

a:visited {
  color:#000;
  text-decoration:none;
}

img {
  border:none;
}

.info {
  padding-left:5px;
}

#footer {
   clear:both;
   background-image: url('Images/footer.jpg');
   height:40px;
   padding-top:5px; 
   padding-right:15px;
   text-align:right;
}
</style>
</head>
<body>
EOF;
}
function userdata($ir,$lv,$fm,$cm,$dosessh=1)
{
global $db,$c,$userid, $set;
$IP = $db->escape($_SERVER['REMOTE_ADDR']);
$db->query("UPDATE `users` SET `laston` = ".$_SERVER['REQUEST_TIME'].",`lastip` = '$IP' WHERE `userid` = $userid");
if(!$ir['email'])
{
global $domain;
die ("<body>Your account may be broken. Please mail help@{$domain} stating your username and player ID.");
}
if($dosessh && ($_SESSION['attacking'] || $ir['attacking']))
{
echo "You lost all your EXP for running from the fight.";
$db->query("UPDATE users SET exp=0,attacking=0 WHERE userid=$userid");
$_SESSION['attacking']=0;
}

$d="";
$u=$ir['username'];
if($ir['donatordays']) { 
$u = "<font color=red>{$ir['username']}</font>";
$d="<img src='donator.gif' alt='Donator: {$ir['donatordays']} Days Left' title='Donator: {$ir['donatordays']} Days Left' />"; }

$gn=""; 
global $staffpage;


print <<<OUT
<div id="wrap">

<div id="top"></div>

<div id="bar">
<ul class='menulinks'>
<li><a href='#'><img src='Images_Ingame/homepage.jpg'></a></li>
<li><a href='#'><img src='Images_Ingame/messages.jpg'></a></li>
<li><a href='#'><img src='Images_Ingame/usersonline.jpg'></a></li>
<li><a href='#'><img src='Images_Ingame/vote.jpg'></a></li>
<li><a href='#'><img src='Images_Ingame/donate.jpg'></a></li>
</ul>
</div>


<div id="nav">

<ul class="nav2">
<b>Name:</b> $gn{$u} [{$ir['userid']}] $d
<b>Money:</b> {$fm}
<b>Level:</b> {$ir['level']}
<b>Points:</b> {$ir['points']}

OUT;
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() {
   define('jdsf45tji', true, true);
       include 'mainmenu.php';
   global $ir,$c;


}
function smenuarea() {
   define('jdsf45tji', true, true);
       include 'smenu.php';
   global $ir,$c;


}
function endpage()
{
global $db;
print <<<OUT


<div id="content">welcome</div>

<div id="footer">Copyright stuff</div>
</div>
</div>
</body>
</html>
OUT;
}
}
?>

 

Checking each function as they come goes a long way

Link to comment
Share on other sites

Try this

 

I keep getting this error:

Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /home/warfarei/public_html/trying/header.php on line 222

when i try to integrate mccodes into my xhtml file.

 

<?php

class headers {
function startheaders() {
global $ir, $set;
echo <<<EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Nerf Warrriors</title>
<style type="text/css">

body {
   background-image: url(Images/bg.jpg);
}

#wrap {
  	background-color: #dfdac6;
width:800px;
margin-left:auto;
margin-right:auto;
border-style: solid;
border-width: 1px;
border-color:#eeeeee;
}

#top {
  background-image: url(Images_Ingame/headerbg.jpg);
  background-repeat:no-repeat;
   width: auto;
height:100px;
}


#bar {
  background-image: url(Images_Ingame/menubg.jpg);
  font-family: arial;
  font-size: 11px;
  margin-top: auto;
  width:100%;
  height: 57px;
}


.menulinks {
  list-style-type:none;
  margin:auto;
}

.menulinks li {
 display:inline-block;
 margin-left:5px;
 margin-top:12px;
}



#nav {
  float:left;
  height:600px;
  width:250px;
  background-image: url('Images_Ingame/navbg.jpg');
  background-repeat:-y;
  padding-right:40px;
  padding-top:15px;
}

#content {
  height:615px;
  text-align:center;
  width:auto;
  background-image: url('Images_Ingame/contentbg.jpg');
  background-repeat:-x;
  margin-left:250px;
}



.nav2 {
  list-style-type:none;
  margin:0px;
}


.nav2 li {
  display:block;
  background-image:url('Images_Ingame/link.jpg');
  width:210px;
  height:20px;
  padding:3px;
  text-align:center;
}

a:link {
  color:#000;
  text-decoration:none;
}

a:hover {
  text-decoration:underline;
}

a:visited {
  color:#000;
  text-decoration:none;
}

img {
  border:none;
}

.info {
  padding-left:5px;
}

#footer {
   clear:both;
   background-image: url('Images/footer.jpg');
height:40px;
padding-top:5px; 
padding-right:15px;
text-align:right;
}
</style>
</head>
<body>
EOF;
}
function userdata($ir,$lv,$fm,$cm,$dosessh=1)
{
global $db,$c,$userid, $set;
$IP = $db->escape($_SERVER['REMOTE_ADDR']);
$db->query("UPDATE `users` SET `laston` = ".$_SERVER['REQUEST_TIME'].",`lastip` = '$IP' WHERE `userid` = $userid");
if(!$ir['email'])
{
global $domain;
die ("<body>Your account may be broken. Please mail help@{$domain} stating your username and player ID.");
}
if($dosessh && ($_SESSION['attacking'] || $ir['attacking']))
{
echo "You lost all your EXP for running from the fight.";
$db->query("UPDATE users SET exp=0,attacking=0 WHERE userid=$userid");
$_SESSION['attacking']=0;
}

$d="";
$u=$ir['username'];
if($ir['donatordays']) { $u = "<font color=red>{$ir['username']}</font>";$d="<img src='donator.gif' alt='Donator: {$ir['donatordays']} Days Left' title='Donator: {$ir['donatordays']} Days Left' />"; }

$gn=""; 
global $staffpage;


print <<<OUT
<div id="wrap">

<div id="top"></div>

<div id="bar">
<ul class='menulinks'>
<li><a href='#'><img src='Images_Ingame/homepage.jpg'></a></li>
<li><a href='#'><img src='Images_Ingame/messages.jpg'></a></li>
<li><a href='#'><img src='Images_Ingame/usersonline.jpg'></a></li>
<li><a href='#'><img src='Images_Ingame/vote.jpg'></a></li>
<li><a href='#'><img src='Images_Ingame/donate.jpg'></a></li>
</ul>
</div>

<div id="content">
OUT;
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).<br />
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() {
define('jdsf45tji', true, true);
echo <<<MENU
<div id="nav">

<ul class="nav2">
<b>Name:</b> $gn{$u} [{$ir['userid']}] $d<br />
<b>Money:</b> {$fm}<br />
<b>Level:</b> {$ir['level']}<br />
<b>Points:</b> {$ir['points']}<br />
MENU;

	include 'mainmenu.php';

echo '</ul>';
global $ir,$c;
}



function smenuarea() {
define('jdsf45tji', true, true);
	include 'smenu.php';
global $ir,$c;

}
function endpage()
{
global $db;
print <<<OUT
</div>
<div id="footer">Copyright stuff</div>
</div>
</div>
</body>
</html>
OUT;
}
}
?>
Edited by BeastTheKidd
Link to comment
Share on other sites

<?php
class headers {
function startheaders() {
global $ir, $set;
echo <<<EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Nerf Warrriors</title>
<style type="text/css">

body {
   background-image: url(Images/bg.jpg);
}

#wrap {
   background-color: #dfdac6;
   width:800px;
   margin-left:auto;
   margin-right:auto;
   border-style: solid;
   border-width: 1px;
   border-color:#eeeeee;
}

#top {
  background-image: url(Images_Ingame/headerbg.jpg);
  background-repeat:no-repeat;
   width: auto;
   height:100px;
}


#bar {
  background-image: url(Images_Ingame/menubg.jpg);
  font-family: arial;
  font-size: 11px;
  margin-top: auto;
  width:100%;
  height: 57px;
}


.menulinks {
  list-style-type:none;
  margin:auto;
}

.menulinks li {
 display:inline-block;
 margin-left:5px;
 margin-top:12px;
}



#nav {
  float:left;
  height:600px;
  width:250px;
  background-image: url('Images_Ingame/navbg.jpg');
  background-repeat:-y;
  padding-right:40px;
  padding-top:15px;
}

#content {
  height:615px;
  text-align:center;
  width:auto;
  background-image: url('Images_Ingame/contentbg.jpg');
  background-repeat:-x;
  margin-left:250px;
}



.nav2 {
  list-style-type:none;
  margin:0px;
}


.nav2 li {
  display:block;
  background-image:url('Images_Ingame/link.jpg');
  width:210px;
  height:20px;
  padding:3px;
  text-align:center;
}

a:link {
  color:#000;
  text-decoration:none;
}

a:hover {
  text-decoration:underline;
}

a:visited {
  color:#000;
  text-decoration:none;
}

img {
  border:none;
}

.info {
  padding-left:5px;
}

#footer {
   clear:both;
   background-image: url('Images/footer.jpg');
   height:40px;
   padding-top:5px;
   padding-right:15px;
   text-align:right;
}
</style>
</head>
<body>
EOF;
}
function userdata($ir,$lv,$fm,$cm,$dosessh=1)
{
global $db,$c,$userid, $set;
$IP = $db->escape($_SERVER['REMOTE_ADDR']);
$db->query("UPDATE `users` SET `laston` = ".$_SERVER['REQUEST_TIME'].",`lastip` = '$IP' WHERE `userid` = $userid");
if(!$ir['email'])
{
global $domain;
die ("<body>Your account may be broken. Please mail help@{$domain} stating your username and player ID.");
}
if($dosessh && ($_SESSION['attacking'] || $ir['attacking']))
{
echo "You lost all your EXP for running from the fight.";
$db->query("UPDATE users SET exp=0,attacking=0 WHERE userid=$userid");
$_SESSION['attacking']=0;
}

$d="";
$u=$ir['username'];
if($ir['donatordays']) {
$u = "<font color=red>{$ir['username']}</font>";
$d="<img src='donator.gif' alt='Donator: {$ir['donatordays']} Days Left' title='Donator: {$ir['donatordays']} Days Left' />"; }

$gn="";
global $staffpage;


print <<<OUT
<div id="wrap">

<div id="top"></div>

<div id="bar">
<ul class='menulinks'>
<li><a href='#'><img src='Images_Ingame/homepage.jpg'></a></li>
<li><a href='#'><img src='Images_Ingame/messages.jpg'></a></li>
<li><a href='#'><img src='Images_Ingame/usersonline.jpg'></a></li>
<li><a href='#'><img src='Images_Ingame/vote.jpg'></a></li>
<li><a href='#'><img src='Images_Ingame/donate.jpg'></a></li>
</ul>
</div>


<div id="nav">

<ul class="nav2">
<b>Name:</b> $gn{$u} [{$ir['userid']}] $d
<b>Money:</b> {$fm}
<b>Level:</b> {$ir['level']}
<b>Points:</b> {$ir['points']}

OUT;
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() {
   define('jdsf45tji', true, true);
       include 'mainmenu.php';
   global $ir,$c;
   echo '</div><div id="content">'; 

}
function smenuarea() {
   define('jdsf45tji', true, true);
       include 'smenu.php';
   global $ir,$c;
   echo '</div><div id="content">';

}
function endpage()
{
global $db;
print <<<OUT

</div><!--/#content-->

<div id="footer">Copyright stuff</div>
</div>
</body>
</html>
OUT;
}
}
?>

Fixed height is not a wise choice, just saying.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...