Hola de nuevo , quiero proteger esta pagina para que no se ingrese si esta registrado o no , este es el codigo y me sale este error
 
<html>
<body bgcolor="#5F7BA9">
<?
 
session_start();
if ($nombre_usuario!="" && $nivel_usuario==2)
{
?>
<?
if($_COOKIE["unick"] ) {
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
Panel de usuario de <b><? echo $_COOKIE["unick"]  ?></b><p align="center"><br>
              <? include("config.php") ;
$resp = mysql_query("select id from usuarios where nick='$_COOKIE[unick]'") ;
$datos = mysql_fetch_array($resp) ;
if(mysql_num_rows($resp) != 0) {
echo "<div align=\"center\"><img src=\"eforo_imagenes/avatares/$datos[id].$datos[avatar]\" width=\"50\" height=\"50\" border=\"0\"></div>" ;
}
?>
</p>
              <form name="form1"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="18%"><div align="center"><a href="uperfil.php"><img src="info.gif" width="49" height="50" border="0"></a></div></td>
                  <td width="28%"><div align="center"><a href="mensajes.php"><img src="messages.gif" width="49" height="50" border="0"></a></div></td>
                  <td width="27%"><div align="center"><img src="home.gif" width="49" height="48"></div></td>
                  <td width="27%"><div align="center"><a href="usalir.php"><img src="exit.gif" width="48" height="49" border="0"></a></div></td>
                </tr>
                <tr>
                  <td><div align="center"><strong><a href="uperfil.php">Editar perfil </a></strong></div></td>
                  <td>
                  <div align="center"><strong><a href="mensajes.php">Mensajes privados</a></strong></div></td>
                  <td><div align="center">
 
                      <select name="menu1" onChange="MM_jumpMenu('parent',this,0)" class="form">
                        <option selected>Enviar:</option>
                        <option value="descarga.php">>> Descarga</option>
                        <option value="comentario.php">>> Comentario</option>
                           </select>
 
                  </div></td>
                  <td><div align="center"><strong><a href="usalir.php">Desconectar</a></strong></div></td>
                </tr>
                <tr>
                  <td> </td>
                  <td><div align="center">Tiene
                    <?
include("config.php") ;
$usuario = $HTTP_COOKIE_VARS[unick] ;
$resp = mysql_query("select id from mensajes where nuevo='0' and destinatario='$usuario'") ;
$mensajes = mysql_num_rows($resp) ;
mysql_free_result($resp) ;
mysql_close($conectar) ;
if($mensajes == 0) { echo "0"
?>
                    <?
}
else {
?>
                      <script>
function BlinkTxt() {
texto = document.getElementsByTagName('blink');
for (i=0; i<texto.length; i++)
if (texto[i].style.visibility=='hidden') {
texto[i].style.visibility='visible';
} else {
texto[i].style.visibility='hidden';
}
setTimeout('BlinkTxt()',100);
}
onload=BlinkTxt;
                      </script>
                      <blink>(<? echo $mensajes ; ?>)</blink>
                    <?
}
?>
mensajes nuevos </div></td>
                  <td><div align="center">
                  </div></td>
                  <td> </td>
                </tr>
              </table>   </form>
              <table width="99%" border="0" align="center" cellpadding="3" cellspacing="1">
                <tr class="4477444441">
                  <td width="24%"><div align="center" class="Estilo1"><b>Usuarios on-line </b></div></td>
                </tr>
                <tr class="4477444441">
                  <td valign="top" class="33334477444441"><? include("uenlinea.php"); ?> </td>
                </tr>
</table>
</p>
<?
}
else {
?>
</div>
<form method="post" action="uentrar.php">
              <div align="center">Nick:<br>
                <input name="nick" type="text" class="form">
                <br>
                Contraseña:<br>
                <input name="contrasena" type="password" class="form">
 
                <br>
                <br>
                <input type="submit" name="entrar" value="Entrar" class="form">
                <input type="hidden" name="pagina" value="<? echo $_SERVER['REQUEST_URI'] ?>">
              </div>
</form>
 
<a href="?id=uregistrar">· Registrate</a><br>
<a href="?id=ucontrasena">· ¿Olvide contraseña?</a><br>
<br> ¿Todavía no tienes una cuenta? Puedes <a href="index.php?id=uregistrar">crearte
            una</a>. Como usuario registrado tendrás ventajas como cambiar tu
            perfil, responder comentarios con tu propio nick y enviar enlaces,
            descargas y scripts.<br>
            <?
}
?>
 
Parse error: parse error, unexpected $end in C:\xampp\htdocs\diicc3\usuarios\mensajes.php on line 215 
   
 

 
  
 
