Page 1 of 1

Parse error: parse error in... why!!?!?!?!

Posted: Sat Jan 24, 2004 4:27 am
by lizlazloz
why do i get parse errors, in parts of the script which arent even php? for example, the error here is on line 123...

Code: Select all

<?php
include("checklogin.php");
include("connect.php");

$sql="select crew from game where name ='". $_COOKIE[access] ."'";
$rs=mysql_query($sql,$conn)
or die("could not execute query");
$row= mysql_fetch_array($rs);
$crew=$row[crew];

$sql="select leader,r1,r2,r3,r4 from crews where name ='". $crew ."'";
$rs=mysql_query($sql,$conn)
or die("could not execute query");
$row1= mysql_fetch_array($rs);

$leader=$row1[leader];
$r1=$row1[r1];
$rold=$row1[r4];
$rold .=",";
$rold .=$_GET[name];



if ( ( $leader == $_COOKIE[access] ) or ( stristr($r1, $_COOKIE[access] )) )
{
if ( $_GET[name] != null )
{
if ( $_GET[accept] == "yes")
{
$requests=str_replace(",". $_GET[name], "", $requests);
$sql="update crews set requests = '". $requests ."', r4 = '". $r4 ."' where name ='". $crew ."'";
$rs=mysql_query($sql,$conn)
or die("could not execute query");
$sql="update game set crew = '". $crew ."' where name ='". $_GET[name] ."'";
$rs=mysql_query($sql,$conn)
or die("could not execute query");
$field=$_GET[name] ." has joined!";
}

}
else
{$field="You must be rank 1 or higher in a crew!";}

?>



<html><head><title>game</title>
<?php
include("textstyle.php");
include("checklogin.php");
?>
</head><body bgcolor=999999>
<table border=0 align=center cellpadding=0 cellspacing=0 style=border-collapse:collapse 

bordercolor=#111111 width=900 bgcolor="#c0c0c0">
<tr><td>
<div align=center>
  <center>

<table border=1 cellpadding=0 cellspacing=0 style=border-collapse:collapse bordercolor=#111111 

width=900 height=66>
  <tr>
    <td width=66% height=59>
      <p align="center"><img border="0" 

src="http://img5.photobucket.com/albums/jpg"></td>
  </tr></table>
  </center>
</div>
<div align=center>
  <center>
  <table border=1 cellpadding=5 cellspacing=0 style=border-collapse:collapse bordercolor=#111111 

width=902 height=1>
  <tr>
  <td width=235 colspan=3 height=1 valign=top>

<?php
include("toolbar.php");
?>

</td>  <td width=650 height=1 valign=top>   
<p align="center"> Choose a new rank...
<br>
<form action="changerank.php" method="get">
<select name="newrank">
<option value="r1">Co - Leader</option>
<option value="r2">Trusted</option>
<option value="r3">Loyal</option>
<option value="r4">Member</option>
</select>
<br>
<input type="hidden" name="name" value="<?php echo($_GET[name]); ?>">
<input type="hidden" name="rank" value="<?php echo($_GET[rank]); ?>">
<input type="hidden" name="crew" value="<?php echo($_GET[id]); ?>">
<input type="sumbit" value="Change.">
</form>


             </td>
<td width='100' valign='top'>

<?php
include("ads.php");
?>

</td>
                </tr>
            </table>
  </div>
</center>
        </td>
    </tr>
    <tr>
        <td>
            <table align='center' width='100%' style='border-collapse: collapse' 

bordercolor='#000000'border='1' cellpadding='3' cellspacing='0'>
                <tr>
                    <td>
                      <p align="center">                <-----------------line 123
                         2004.</p>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>

</body></html>

Posted: Sat Jan 24, 2004 5:30 am
by McGruff
You're missing a closing curly bracket in an if statement.

Indenting code helps to spot these problems. Also, most coding programs will let you check if open brackets have been closed.