HELP!!!!

crazy parse error (PHP)

Page 1 of 1

1 Replies - 1338 Views - Last Post: 20 December 2001 - 11:41 AM Rate Topic: -----

#1 LammaDog  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 114
  • Joined: 30-September 01

HELP!!!!

Posted 20 December 2001 - 11:23 AM

OMG!!!  parse errors are usally way easy to fix,  but this one has me pulling what little hairs I have left on the top of my head.

The error I get is....
Parse error: parse error, expecting `'('' in /home/hsphere/local/home/wwwuse0/guardianhosting.net/plans.php on line 97

but, all my brackets are closed!!!!!!
I've checked it and checked it and checked it some more
I even ran a search on (  and a search on )
and I have 33 of each!!!


here's the source.....     anyone have any ideas?????


<?php

/************************************************************************/
/* Displays the Guardain Hosting Plans
/* scripted by Troy,  December 18, 2001
/* send $plan variable to this link
/*************************************************************************/


if (!isset($mainfile))
{
include("mainfile.php");
$index = 1;
include("header.php");
OpenTable();


// connect to database
$db_server= "localhost";//database server location
$db_type= "mysql";//mysql, pgsql, oracle, etc..
$db_db= "forum";//database to use
$db_username= "forum";//username for $db_db
$db_password= "forum";//password for $db_db

if(isset($CONNECT))
{
   return;
}
$CONNECT=1;

if ($db_type == "mysql")
{
 $mysql_link = mysql_connect("$db_server", "$db_username", "$db_password");
 if (!$mysql_link)
{
  print "<B>$l_error</B> <I>Can't connect to database</I>
";
  exit;
   }
mysql_select_db($db_db, $mysql_link);  
}


$query = mysql_query("select * from home_plans where name = '$plan'");
$row = mysql_fetch_object($query);

$fp = fopen ("plan.tml", "r");

$fields = array("name",
"rate",
"setup",
"bw_free",
"bw_extra",
"bw_rate",
"hd_free",
"hd_extra",
"hd_rate");

$counter = 0;

if (isset($showcode))
{
print "The Parse Codes that you can use in the plan.tml file are<br><br>";
}

while(isset($fields[$counter]))
{
$parsecode[$counter] = "{";
$parsecode[$counter] .= $fields[$counter];
$parsecode[$counter] .= "}";

if (isset($showcode))
{
print $counter;
print $parsecode[$counter];
}

$counter++;
}

while (!feof ($fp))  
{
$buffer = fgets ($fp, 4096);


if (strstr($buffer, "{"))
{

$counter = 0;
while(isset($fields[$counter]))
{
if strstr($buffer,$parsecode)
{
$parsed = str_replace($parscode, $field[$counter], $buffer);
}
$counter++;

}

echo $parsed;
}
else
{
echo $buffer;
}
}


fclose ($fp);


CloseTable();
include("footer.php");
}

?>

(Edited by LammaDog at 1:23 pm on Dec. 20, 2001)


Is This A Good Question/Topic? 0
  • +

Replies To: HELP!!!!

#2 The Neoracle  Icon User is offline

  • Check, check, 1, 2.
  • member icon

Reputation: 21
  • View blog
  • Posts: 4,097
  • Joined: 30-March 01

Re: HELP!!!!

Posted 20 December 2001 - 11:41 AM

You have one to many } I think.  Looking threw it I think your fine untill you get to:
while (!feof ($fp))   
{ 

Then you have 5 {'s and 6}'s

Hope that helps.

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1