Foros del Web » Programando para Internet » PHP »

Extraño error

Estas en el tema de Extraño error en el foro de PHP en Foros del Web. Bien, pues cree una pagina en htm (diseño) y le añadi el codigo php para el registro de usuarios y login, pero me da un ...
  #1 (permalink)  
Antiguo 22/04/2006, 05:13
 
Fecha de Ingreso: abril-2006
Mensajes: 5
Antigüedad: 18 años
Puntos: 0
Pregunta Extraño error

Bien, pues cree una pagina en htm (diseño) y le añadi el codigo php para el registro de usuarios y login, pero me da un error que dice esto:
Cita:
Parse error: parse error, unexpected $ in /www/sites/1/iespana.es/p/r/proscripters/site/index.php on line 93
Le añado el "$" pero me lo sigue diciendo. Aqui os dejo el code de la web:
Cita:
<html>
<p align="center"><iframe src width="1" height="1"
marginwidth="0" marginheight="0" hspace="0" vspace="0"
frameborder="0" scrolling="no"></p>
<head>
<title>ProScripters</title>
</head>

<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<table width="128" cellspacing="0" border="1" bordercolordark="white" bordercolorlight="black" align="left">
<tr>
<td width="122" background="bg1.gif"><span style="font-size:10pt;"><font face="Tahoma"><b>Menu</b></font></span></td>
</tr>
<tr>
<td width="122" background="bg2.gif"><span style="font-size:10pt;"><font face="Tahoma">ProScripters</font></span></td>
</tr>
<tr>
<td width="122"><span style="font-size:10pt;"><font face="Tahoma">Index</font></span></td>
</tr>
<tr>
<td width="122" background="bg2.gif"><span style="font-size:10pt;"><font face="Tahoma">Scripting</font></span></td>
</tr>
<tr>
<td width="122"><span style="font-size:10pt;"><font face="Tahoma">Tutoriales<br>Programas<br>Pantallaz os<br>Zona ScrDean</font></span></td>
</tr>
<tr>
<td width="122" background="bg2.gif"><span style="font-size:10pt;"><font face="Tahoma">Programacion VB</font></span></td>
</tr>
<tr>
<td width="122"><span style="font-size:10pt;"><font face="Tahoma">Tutoriales</font></span></td>
</tr>
<tr>
<td width="122" background="bg2.gif"><span style="font-size:10pt;"><font face="Tahoma">Webs Amigas</font></span></td>
</tr>
<tr>
<td width="122"><span style="font-size:10pt;"><font face="Tahoma">Foro-Sd</font></span></td>
</tr>
<tr>
<td width="122" background="bg2.gif"><span style="font-size:10pt;"><font face="Tahoma">Login</font></span></td>
</tr>
<tr>
<td width="122">
<p><span style="font-size:10pt;"><font face="Tahoma">







else
{
<b><br><?=$_COOKIE["Bienvenid@" & unick]?></b><?
if(!$_COOKIE[uid]) {
?>
}
<b>Nick:</b><br>
<input type="text" name="nick" maxlength="20" size="17"><br>
<b>Contraseña:</b><br>
<input type="text" name="contrasena" maxlength="20" size="17"><br>
<input type="submit" name="enviar" value="Iniciar Sesión">
</font><a href="usalir.php"><font face="Tahoma"> Salir</font></a><font face="Tahoma">






</font></span><span style="font-size:10pt;"><font face="Tahoma"><span style="font-size:10pt;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></font><font face="Tahoma"> <a href="uregistrar.php"><span style="font-size:10pt;"><font face="Tahoma">Registrate</font></span></a></p>
</td>
</tr>
</table>


<table width="38" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="28" height="209">&nbsp;</td>
</tr>
</table>

<table border="1" cellspacing="0" bordercolordark="white" bordercolorlight="black">
<tr>
<td width="647" background="bg1.gif"><b><span style="font-size:10pt;"><font face="Tahoma">Noticias</font></span></b></td>
</tr>
<tr>
<td width="647" background="bg2.gif"><span style="font-size:10pt;"><font face="Tahoma">Inaguracion de la web</font></span></td>
</tr>
<tr>
<td width="647" height="28"><font face="Tahoma"><span style="font-size:10pt;">Bien! Al fin inaguré la web, dentro de poco empezaré a añadir gente al team y rellenaré las secciones que por ahora están vacias!</span></font></td>
</tr>
</table>
</body>
</html>
La linia 93 es la de </html>
A ver si me lo podeis solucionar
Saludos,
SN4K3
  #2 (permalink)  
Antiguo 22/04/2006, 05:37
Avatar de david_M_G  
Fecha de Ingreso: febrero-2005
Mensajes: 938
Antigüedad: 19 años, 2 meses
Puntos: 20
Código PHP:
if(!$_COOKIE[uid]) {
?> 
Cierra lo que has abierto. Te marca la línea de </html> porque es la última
  #3 (permalink)  
Antiguo 22/04/2006, 05:43
 
Fecha de Ingreso: abril-2006
Mensajes: 5
Antigüedad: 18 años
Puntos: 0
Ahora me dice
Cita:
Parse error: parse error, unexpected T_IF in /www/sites/1/iespana.es/p/r/proscripters/site/index.php on line 94
  #4 (permalink)  
Antiguo 22/04/2006, 22:39
Avatar de jmn2k1  
Fecha de Ingreso: noviembre-2001
Ubicación: Buenos Aires...
Mensajes: 489
Antigüedad: 22 años, 5 meses
Puntos: 2
if(!$_COOKIE[uid]) {
?>
}
<b>Nick:</b><br>

Esa llave no se supone que deberia estar dentro del "?>" y al final del documento??
__________________
JmN
  #5 (permalink)  
Antiguo 23/04/2006, 05:48
 
Fecha de Ingreso: junio-2002
Mensajes: 750
Antigüedad: 21 años, 10 meses
Puntos: 22
Consejos: para carácteres especiales (ñ, acentos ...) utiliza &ntilde; (ñ), etc...
En el primer iframe quita 'src':
Cita:
<iframe src width="1" height="1"
marginwidth="0" marginheight="0" hspace="0" vspace="0"
frameborder="0" scrolling="no">
Cerrar etiqueta iframe
Cita:
<p align="center"><iframe width="1" height="1" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe></p>
Quita las etiquetas span y font
Cita:
</font></span><span style="font-size:10pt;"><font face="Tahoma"><span style="font-size:10pt;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></font><font face="Tahoma"> <a href="uregistrar.php"><span style="font-size:10pt;"><font face="Tahoma">Registrate</font></span></a></p>
Esta parte:
Cita:
else
{
<b><br><?=$_COOKIE["Bienvenid@" & unick]?></b><?
if(!$_COOKIE[uid]) {
?>
}
No debería ser algo así? (más o menos)
Cita:
<br>
<?php
if(!$_COOKIE['uid'])
{
echo '<b>Bienvenid@' . $_COOKIE['uid'] . $unick . '</b>'; /* pon la cookie que uses tu y lo de unick no se si es de una variable o de otra cookie */
}
else
{
echo 'Bienvenid@ Invitado';
}
?>
El error que daba debe estar causado por está última parte.
También he visto diversas etiquetas anidadas que hacen la misma función. Podrías reducir el código quitando las sobrantes.
Ej.
En lugar de:
<span style="font-size:10pt;"><font face="Tahoma">Texto1</font></span>
<br>
<span style="font-size:10pt;"><font face="Tahoma">Texto2</font></span>

Agruparlo:
<span style="font-size:10pt;"><font face="Tahoma">
Texto1
<br>
Texto2
</font></span>


Salu2
  #6 (permalink)  
Antiguo 25/04/2006, 12:59
 
Fecha de Ingreso: abril-2006
Mensajes: 5
Antigüedad: 18 años
Puntos: 0
Wow gracias, funciono ;)
  #7 (permalink)  
Antiguo 25/04/2006, 17:28
 
Fecha de Ingreso: junio-2002
Mensajes: 750
Antigüedad: 21 años, 10 meses
Puntos: 22
OK! Me alegro
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 04:44.