Jump to content


Photo

syntax error, unexpected $end


  • Please log in to reply
2 replies to this topic

#1 rtp

rtp
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 22 August 2006 - 01:22 AM

I can't find anything wrong with the code. IT'S DRIVING ME INSANE!!!

Full error message:
Parse error: syntax error, unexpected $end in /home/galle15y/public_html/imagetemplate.php on line 200
(200 is the last line in the code)

Code:
<?php
if(isset( $_COOKIE['userGroup'] ) and ( $_COOKIE['userGroup'] == 'user' ))
	{ header( 'Location:' ); }
else
	{ header( 'Location:Login.php?error=Access Denied' ); }
?>
<?php 
	$conn_gallery = mysql_connect( 'localhost' , 'galle15y' , 'UiEcr8t1' );
	$database_conn_gallery = 'galle15y_gallery';
?>
<?php
#Spaceart if
if (isset($_GET['spaceartname'])) {
  $colname_spaceart = (get_magic_quotes_gpc()) ? $_GET['spaceartname'] : addslashes($_GET['spaceartname']);
  
#Spaceart Recordset
mysql_select_db($database_conn_gallery, $conn_gallery);
$query_spaceart = sprintf("SELECT spaceartname, url FROM spaceart WHERE spaceartname = '%s'", $colname_spaceart);
$spaceart = mysql_query($query_spaceart, $conn_gallery) or die(mysql_error());
$row_spaceart = mysql_fetch_assoc($spaceart);
$totalRows_spaceart = mysql_num_rows($spaceart);
}
else
#Photo if
if (isset($_GET['photoname'])) {
  $colname_photo = (get_magic_quotes_gpc()) ? $_GET['photoname'] : addslashes($_GET['photoname']);
  
#Photo Recordset
mysql_select_db($database_conn_gallery, $conn_gallery);
$query_photo = sprintf("SELECT photoname, url FROM photography WHERE photoname = '%s'", $colname_photo);
$photo = mysql_query($query_photo, $conn_gallery) or die(mysql_error());
$row_photo = mysql_fetch_assoc($photo);
$totalRows_photo = mysql_num_rows($photo);
}
else
#Wallpaper if
if (isset($_GET['wpname'])) {
  $colname_wallpapers = (get_magic_quotes_gpc()) ? $_GET['wpname'] : addslashes($_GET['wpname']);
  
#Wallpapers Recordset
mysql_select_db($database_conn_gallery, $conn_gallery);
$query_wallpapers = sprintf("SELECT wpname, imageurl FROM wallpapers WHERE wpname = '%s'", $colname_wallpapers);
$wallpapers = mysql_query($query_wallpapers, $conn_gallery) or die(mysql_error());
$row_wallpapers = mysql_fetch_assoc($wallpapers);
$totalRows_wallpapers = mysql_num_rows($wallpapers);
}
else
#Terragen if
if (isset($_GET['tgname'])) {
  $colname_terragen = (get_magic_quotes_gpc()) ? $_GET['tgname'] : addslashes($_GET['tgname']);
  
#Terragen Recordset
mysql_select_db($database_conn_gallery, $conn_gallery);
$query_terragen = sprintf("SELECT tgname, imageurl FROM terragen WHERE tgname = '%s'", $colname_terragen);
$terragen = mysql_query($query_terragen, $conn_gallery) or die(mysql_error());
$row_terragen = mysql_fetch_assoc($terragen);
$totalRows_terragen = mysql_num_rows($terragen);
}
else
#Terragen-Art if
if (isset($_GET['tgartname'])) {
  $colname_terragenart = (get_magic_quotes_gpc()) ? $_GET['tgartname'] : addslashes($_GET['tgartname']);
  
#Terragen Art Recordset
mysql_select_db($database_conn_gallery, $conn_gallery);
$query_terragenart = sprintf("SELECT terragenname, imageurl FROM terragenart WHERE tgartname = '%s'", $colname_terragenart);
$terragenart = mysql_query($query_terragenart, $conn_gallery) or die(mysql_error());
$row_terragenart = mysql_fetch_assoc($terragenart);
$totalRows_terragenart = mysql_num_rows($terragenart);
?>
<?php
if(isset( $_GET['spaceartname'] ) )
	{
		$title = $row_spaceart['spaceartname'];
		$image = $row_spaceart['url'];
	}
else
if(isset( $_GET['photoname'] ) )
	{
		$title = $row_photo['photoname'];
		$image = $row_photo['url'];
	}
else
if(isset( $_GET['wpname'] ) )
	{
		$title = NULL;
		$image = $row_wallpapers['imageurl'];
	}
else
if(isset( $_GET['tgname'] ) )
	{
		$title = NULL;
		$image = $row_terragen['imageurl'];
	}
else
if(isset( $_GET['tgartname'] ) )
	{
		$title = $row_terragenart['terragenname'];
		$image = $row_terragenart['imageurl'];
	}
?>
<?php
if(isset( $_GET['spaceartname'] ) )
	{
		$head = 'Spaceart';
		$subhead = $row_spaceart['spaceartname'];
	}
else
if(isset( $_GET['photoname'] ) )
	{
		$head = 'Photography';
		$subhead = $row_photo['photoname'];
	}
else
if(isset( $_GET['wpname'] ) )
	{
		$head = 'Wallpaper';
		$subhead = NULL;
	}
else
if(isset( $_GET['tgname'] ) )
	{
		$head = 'Terragen';
		$subhead = NULL;
	}
else
if(isset( $_GET['tgartname'] ) )
	{
		$head = 'Terragen';
		$subhead = $row_terragenart['terragenname'];
?>
<?php
if(isset( $_COOKIE['name'] ))
	{ $userName = $_COOKIE['name']; }
else
	{ $userName = '<B>visitor</b>'; }
?>	
<?php
if(isset( $_COOKIE['name'] ))
	{ $login = '<a href="Logout.php">Log-out</a>'; }
else
	{ $login = '<a href="Login.php">Log-in</a>'; }
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>The Gallery - <?php echo( $head ); ?> - <?php echo( $subhead ); ?> </title>
<link href="../thegalleryCSS.css" rel="stylesheet" type="text/css">
</head>
<body>
<center>
  <table id="nav panel">
<tr>
<td width="900"><img src="../universalbanner.jpg"></td>
</tr>
<tr>
<td><a href="Home.php">Home</a>::<a href="About.php">About</a>::<a href="Gallery.php">Gallery</a>::<a href="Resources.php">Resources</a>::<a href="Requests.php">Requests</a>::<?php echo( $login ); ?>::<a href="Register.php">Register</a></td>
</tr>
<tr>
<td>

<P>Welcome, <?php echo( $userName ); ?>!</P>
</td>
</tr>
</table>
<BR>
<table id="content">
<tr>
  <td width="900" height="26" colspan=3>
    <H2><center><?php echo( $title ); ?></center></H2>
  </td>
</tr>
<tr>
  <td height="600">
	 <P><img src="<?php echo( $image ); ?>"></P>
	 
  </td>
</tr>
</table>
<P class="copyright">Art and Design(C) 2006 Dale Dombrowski.  Nothing may be duplicated or ripped without explicit permission</P>

</center>
</body>
</html>
<?php
if(isset( $_GET['spaceartname'] ) )
	{ mysql_free_result($spaceart); }
else
if(isset( $_GET['photoname'] ) )
	{ mysql_free_result($photo); }
else
if(isset( $_GET['wpname'] ) )
	{ mysql_free_result($wallpapers); }
else
if(isset( $_GET['tgname'] ) )
	{ mysql_free_result($terragen); }
else
if(isset( $_GET['tgartname'] ) )
	{ mysql_free_result($terragenart); }
?>


#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 22 August 2006 - 01:34 AM

That means you are missing a closing curly brace ( } ).  Looks like it make be here:

if(isset( $_GET['tgartname'] ) )
	{
		$head = 'Terragen';
		$subhead = $row_terragenart['terragenname'];
?>


#3 rtp

rtp
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 22 August 2006 - 01:50 AM

thank you. turns out there were two missing brackets!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users