4 Replies - 488 Views - Last Post: 18 March 2009 - 12:31 PM Rate Topic: -----

#1 OneNinetyNiner  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 17-March 09

Php error

Post icon  Posted 17 March 2009 - 04:08 PM

I'm getting an error with a php script, it is a members area, and i'm trying to display a link to only admins
but i get this error


Parse error: syntax error, unexpected '<' in /hosted/subs/ulmb.com/u/l/ultimatebully/public_html/member.php on line 67

i can't seem to find the " < " please help would be appreciated

here is the code
 <?php
session_start();
if($_SESSION['s_logged_n'] == 'true'){
$_SESSION['id'];
include 'process.php';
?>
<html>
<head>
<!-- TemplateBeginEditable name="doctitle" -->
<title>Members Page</title>
<!-- TemplateEndEditable -->
<link href="style.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
</head>

<body bgcolor="#000000" text="#FFFFFF" link="#FFFFFF">
<div id="wrapper">
<br>
<table width="983" border="0" cellpadding="1" cellspacing="2" bordercolor="#FFFFFF">
  <!--DWLayoutDefaultTable-->
  <tr>
	<td width="109" height="1"></td>
	<td width="705"></td>
	<td width="155"></td>
  </tr>
  <tr>
	<td height="11" colspan="3" valign="top" bgcolor="#333333"><!--DWLayoutEmptyCell--></td>
  </tr>
  <tr>
	<td height="536" valign="top" bgcolor="#333333"><p>[General]<br>
		<br> 
		<br>
	  </p>
	  <p></p>
	<p></p>
	<p></p>
	<p></p>
	<p><a href="logout.php"><br>
	</a></p>
	<p></p>
	<p></p>
	<p></p>
	<p></p>
	<p><a href="logout.php">	  Logout</a></p></td>
	<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">
	  <!--DWLayoutTable-->
	  <tr>
		<td width="705" height="515"><h1 align="center"><strong>THIS IS A TEST!</strong></h1></td>
	  </tr>
	  <tr>
		<td height="19" valign="top"><!--DWLayoutEmptyCell--></td>
  </tr>
	</table>
	</td>
	<td valign="top" bgcolor="#333333"> <p>[Info]<br>
	  Username:
		<?php
		echo $_SESSION['s_username'];
		?>
		<?php
$row = mysql_fetch_array($query);
if($row['Admin'] == 1)
{ 
echo 
 <p><a href="admin.php">Admin Panel</a>;
 ?>
<br>
	Money:</p>
	 
	</p></td>
  </tr>
</table>
</body>
</html>


} else {
header("Location: index.php");
}
?>



thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Php error

#2 Valek  Icon User is offline

  • The Real Skynet
  • member icon

Reputation: 543
  • View blog
  • Posts: 1,713
  • Joined: 08-November 08

Re: Php error

Posted 17 March 2009 - 04:18 PM

echo
 <p><a href="admin.php">Admin Panel</a>;


I figure you might want that echo string in quotes ;)

You also have some code with a closing tag at the end, but no opening tag beforehand. That'll print your code onto your page.

And you might want to remove the space before your opening tag, or session_start() will throw a fit.

This post has been edited by Valek: 17 March 2009 - 04:21 PM

Was This Post Helpful? 0
  • +
  • -

#3 OneNinetyNiner  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 17-March 09

Re: Php error

Posted 18 March 2009 - 09:08 AM

View PostValek, on 17 Mar, 2009 - 03:18 PM, said:

echo
 <p><a href="admin.php">Admin Panel</a>;


I figure you might want that echo string in quotes ;)

You also have some code with a closing tag at the end, but no opening tag beforehand. That'll print your code onto your page.

And you might want to remove the space before your opening tag, or session_start() will throw a fit.


thanks man
i've fiddled around with it, and now im getting this error

Parse error: syntax error, unexpected $end in /hosted/subs/ulmb.com/u/l/ultimatebully/public_html/member.php on line 75

here's the code:
<?php
session_start();
if($_SESSION['s_logged_n'] == 'true'){
$_SESSION['id'];
include 'process.php';
?>
<html>
<head>
<!-- TemplateBeginEditable name="doctitle" -->
<title>Members Page</title>
<!-- TemplateEndEditable -->
<link href="style.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
</head>

<body bgcolor="#000000" text="#FFFFFF" link="#FFFFFF">
<div id="wrapper">
<br>
<table width="983" border="0" cellpadding="1" cellspacing="2" bordercolor="#FFFFFF">
  <!--DWLayoutDefaultTable-->
  <tr>
	<td width="109" height="1"></td>
	<td width="705"></td>
	<td width="155"></td>
  </tr>
  <tr>
	<td height="11" colspan="3" valign="top" bgcolor="#333333"><!--DWLayoutEmptyCell-->&nbsp;</td>
  </tr>
  <tr>
	<td height="536" valign="top" bgcolor="#333333"><p>[General]<br>
		<br> 
		<br>
	  </p>
	  <p>&nbsp;</p>
	<p>&nbsp;</p>
	<p>&nbsp;</p>
	<p>&nbsp;</p>
	<p><a href="logout.php"><br>
	</a></p>
	<p>&nbsp;</p>
	<p>&nbsp;</p>
	<p>&nbsp;</p>
	<p>&nbsp;</p>
	<p><a href="logout.php">	  Logout</a></p></td>
	<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">
	  <!--DWLayoutTable-->
	  <tr>
		<td width="705" height="515"><h1 align="center"><strong>THIS IS A TEST!</strong></h1></td>
	  </tr>
	  <tr>
		<td height="19" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
  </tr>
	</table>
	</td>
	<td valign="top" bgcolor="#333333"> <p>[Info]<br>
	</body>

</html>
	  Username:
		<?php
		echo $_SESSION['s_username'];
$row = mysql_fetch_array($query);
if($row['Admin'] == 1)
{ 
echo  "<p><a href=admin.php>Admin Panel</a>";

} else {
header("Location: index.php");
}



?>


there clearly is a closing tag in there
i hope i'm not asking for much
Was This Post Helpful? 0
  • +
  • -

#4 William_Wilson  Icon User is offline

  • lost in compilation
  • member icon

Reputation: 205
  • View blog
  • Posts: 4,807
  • Joined: 23-December 05

Re: Php error

Posted 18 March 2009 - 09:12 AM

Since your code is only 74 lines, It seems like it is a bracket mismatch.

At the top of your php code you have: if($_SESSION['s_logged_n'] == 'true'){ but you never close the brackets. This { either needs to be removed or a matching } needs to be added depending on what you want the code to do with this if statement.
Was This Post Helpful? 0
  • +
  • -

#5 OneNinetyNiner  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 17-March 09

Re: Php error

Posted 18 March 2009 - 12:31 PM

Thanks mate
its working now
cheers
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1