Jump to content

strange parse error


robos99

Recommended Posts

So I've tried everything to fix this parse error "Parse error: parse error, unexpected $ in global.php on line 205" and nothing seems to be working. I don't even know what that error means, but I've double checked all quotes, semicolons, brackets, everything. Here's the bit of code that's giving me trouble...

[code]
if(!$fillwidth){
     $fillwidth=$size-$masterwidth;
       }

echo "<img src=\"../$imagefolder/redbar.gif\" height=\"$height\" width=\"$fillwidth\">" . $subbar_bit . "\n\n";  

?>

</td>\n
    </tr>\n
    <tr>\n
      <td width="20" height="578" valign="top" rowspan="2">&nbsb;</td>
      <td width="752" height="520" valign="top" bgcolor="#FFFFFF" bordercolor="#FFFFFF">
        <p align="center">&nbsp;</td>
      <td width="20" height="578" valign="top" rowspan="2">&nbsp;</td>
    </tr>
    <tr>[/code]

Now technically line 205 is off the page, which is the really confusing part since that's straight HTML there. I originally had the little bit of HTML at the bottom as part of an echo statement, but due to this error I just decided to end the script before it. That hasn't helped at all. Can anyone figure this out?
Link to comment
Share on other sites

Update, just discovered that despite all the changes I make to the code, the server keeps ignoring them and reverting to the old file, so for all I know I may have fixed this problem already. But if it's painfully obvious to anyone what I'm doing wrong here, I'd sure like to know so I don't make the mistake again.
Link to comment
Share on other sites

[!--quoteo(post=351773:date=Mar 5 2006, 01:12 AM:name=Hooker)--][div class=\'quotetop\']QUOTE(Hooker @ Mar 5 2006, 01:12 AM) [snapback]351773[/snapback][/div][div class=\'quotemain\'][!--quotec--]
that was me having a bit of a moment lol there doesnt seem to be an error in that block at all, can we maybe see the rest of the script?
[/quote]

Here's the whole script. This gets included with all scripts running on this site. Basically the intent is to create a "shell" of a site, with just 1 page of code. I've omitted the email address for spam reasons, but those are normally in there.

[code]<?php
//global.php


$webmasteremail='';
$technicalemail='';
$title='Paradise City Entertainment';
$imagefolder='/images/';
define('INDEXPAGE','index2.php');

$location=explode('/',$_SERVER['PHP_SELF']);
  if(!isset($location[1])){
    $isroot=TRUE;
   } else {
    $isroot=FALSE;
    $folder=$location[0];
    $file=$location[1];
     }

$file=explode('.',$file);
$filename=$file[0];
$extension=$file[1];

$production=array('livesound','lighting','design');
$promo=array('graphicdesign','web','printing','streetteam');
$events=array('booking','calendar','pastevents');
$navbar=array('production','dj','promo','events','gallery','testimonials');
$index=array('forums','calendar','about','contact');

$metatags='';


//############### functions ######################

function footer(){

echo "<td width="754" height="66" valign="middle" bgcolor="#000000">
        <p align="center"><font color="#FFFFFF"><a href="index.htm">Home</a> | <a href="about.htm">About
        Us</a> | <a href="contact.htm">Contact</a> | <a href="/forums/index.php">Forums</a>
        | <a href="calendar.php">Calendar<br>
        </a><font size="2">Copyright 2006 Paradise City Entertainment</font></font></td>
    </tr>
  </table>
  </center>
</div>
</body>

</html>";





//################## start page output ##################

echo "<html>\n\n
<head>\n
<meta http-equiv=\"Content-Language\" content=\"en-us\">\n
<meta http-equiv=\"Content-Type\" content=\"text/html\; charset=windows-1252\">\n
<meta name=\"GENERATOR\" content=\"Microsoft FrontPage 4.0\">\n
$metatags\n
<script language=\"JavaScript\" fptype=\"dynamicanimation\">\n
<!--\n
function dynAnimation() {}\n
function clickSwapImg() {}\n
//-->\n
</script>\n
<script language=\"JavaScript1.2\" fptype=\"dynamicanimation\" src=\"animate.js\">\n
</script>\n
<title>$title</title>\n
</head>\n\n";

//############### start body output ####################

echo "
<body bgcolor=\"#FFFFFF\" onload=\"dynAnimation()\">\n
<div align=\"center\">\n
  <center>\n
  <table border=\"0\" width=$masterwidth height=\"788\" cellpadding=\"0\" bgcolor=\"#000000\" bordercolor=\"#000000\" cellspacing=\"0\">\n
    <tr>\n
      <td width=$masterwidth height=\"206\" valign=\"top\" colspan=\"3\">\n
<img border=\"0\" src=\"header.png\" width=$masterwidth height=\"66\">\n
<a href=\"INDEXPAGE.php\"><img border=\"0\" src=\"logo.gif\" width=$masterwidth height=\"55\"></a>\n\n
<!--start nav bar//-->\n";

//########### start navbar build ##############

foreach($navbar as $val){

if($location == INDEXPAGE){

$img=$imagefolder . $val . ".gif";
$img_alt=$imagefolder . $val . "_alt.gif";
$link="/$val/$val.php";

} else if((!$isroot) && ($folder==$val)){

$img="..$imagefolder" . $val . "_alt.gif";
$link="$val.php";

  } else if((!$isroot) && ($folder!=$val)){

  $img="..$imagefolder$val.gif";
  $img_alt="..$imagefolder" . $val . "_alt.gif";
  $link="../$val.php";

   }

if(isset($img_alt)){
echo "<a onmouseover=\"document['fpAnimswapImgFP1'].imgRolln=document['fpAnimswapImgFP1'].src\;
document['fpAnimswapImgFP1'].src=document['fpAnimswapImgFP1'].lowsrc\;\" onmouseout=\"document['fpAnimswapImgFP1'].src=document['fpAnimswapImgFP1']
.imgRolln\" href=\"$link\"><img border=\"0\" src=\"$imagefolder$img\" id=\"fpAnimswapImgFP1\" name=\"fpAnimswapImgFP1\" dynamicanimation=\"fpAnimswapImgFP1\" lowsrc=\"$imagefolder$img_alt\" width=\"145\" height=\"35\"></a>";

} else {

echo "<a href=\"$link\"><img border=\"0\" src=\"$img\" width=\"145\" height=\"35\"></a>";

}
//insert separator slash
echo "<img src=\"slash.gif\">\n";

  }

//############# start sub-navbar build ########################

$subbar_bit='';
$size=0
unset($fillwidth);

if($isroot){

if(is_array($index)){
  foreach($index as $key=>$val){

       if($val==$filename){
         $img=$imagefolder . $val . "_alt.gif";
        } else {
         $img=$imagefolder . $val . ".gif";
         $link="/$val.php";
           }

      list($width,$height,$type,$attr)=getimagesize($img);
       $size=+$width;

       if(isset($link)){
         if($filename=='forums'){
            $link="/forums/index.php";}
       $subbar_bit=. "<a href=\"$link\"><img src=\"$img\" $attr alt=\"$key\"></a>\n";
         } else {
            $subbar_bit=. "<img src=\"$img\" $attr alt=\"$key\">\n";

         } else {
        $fillwidth=$masterwidth;
        }
   } else {

     eval("\$arr=\$$folder;");

   if(is_array($arr)){
      
       foreach($arr as $key=>$val){

           if($val==$filename){
         $img="../" . $imagefolder . $val . "_alt.gif";
        } else {
         $img="../" . $imagefolder . $val . ".gif";
         $link="/$val.php";
           }

      list($width,$height,$type,$attr)=getimagesize($img);
       $size=+$width;

       if(isset($link)){
         if($filename=='forums'){
            $link="/forums/index.php";}
       $subbar_bit=. "<a href=\"$link\"><img src=\"$img\" $attr alt=\"$key\"></a>\n";
         } else {
            $subbar_bit=. "<img src=\"$img\" $attr alt=\"$key\">\n";  

     } else {
        $fillwidth=$masterwidth;
         }
       }

echo "<img src=\"../$imagefolder/redbar.gif\" height=\"$height\" width=\"$fillwidth\">" . $subbar_bit . "\n\n";  

?>

</td>\n
    </tr>\n
    <tr>\n
      <td width="20" height="578" valign="top" rowspan="2">&nbsb;</td>
      <td width="752" height="520" valign="top" bgcolor="#FFFFFF" bordercolor="#FFFFFF">
        <p align="center">&nbsp;</td>
      <td width="20" height="578" valign="top" rowspan="2">&nbsp;</td>
    </tr>
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.