Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

InTroX

[Resolvido] Erro de syntax no Php

Recommended Posts

O seguinte erro é dado ao executar a páginas usuarios.php

 

 

Parse error: syntax error, unexpected '}' in /home/brteam18/public_html/estacionados/radiolol/clube/usuarios.php on line 26

 

 

Segue abaixo o Código da página

 

<?php
include "config.php";
$resultado = mysql_query("SELECT * FROM usuarios_clube");
while($hebert = mysql_fetch_assoc($resultado)){
$login    = $hebert['login'];
$nome    = $hebert['nome'];
$senha    = $hebert['senha'];
$sexo     = $hebert['sexo'];
$nascimento    = $hebert['nascimento'];
$estado   = $hebert['estado'];
$cidade   = $hebert['cidade'];
$bairro   = $hebert['bairro'];
$msn      = $hebert['msn'];
$skype    = $hebert['skype'];
$orkut    = $hebert['orkut'];
$twitter  = $hebert['twitter'];
$foto     = $hebert['foto'];
$id = $HTTP_COOKIE_VARS["login"];
}

?>


				<div class="box_05_3_2_1_2" onClick="abrirPerfil('<? echo $nome ?>')" style="cursor:pointer;" title="Ver perfil de <? echo $nome ?>"><img src="<? echo $foto ?>" width="50" height="50" class="box_05_3_2_1_2_1"/><br><? echo $nome ?></div>

     <?php } ?> <div class="box_05_3_2_1_3">Quer aparecer? Cadastre-se!</div>
				</div>

 

 

 

Fico no aguardo o mais breve possivel,

agradeço desde já

Compartilhar este post


Link para o post
Compartilhar em outros sites

Daonde inicia esse <?php } ?> ?

Não sei lhe responder, pois esses sietam peguei pronto e to corrigindo...

 

indique qual é a linha 26

 

 

sempre indique qual é a linha

contar até 26 é fácil, mas se o erro fosse na linha 200, por exemplo,, dificilmente receberia resposta a seu tópico :thumbsup:

 

a linha 26 é:

 

      <?php } ?> <div class="box_05_3_2_1_3">Quer aparecer? Cadastre-se!</div> 

Compartilhar este post


Link para o post
Compartilhar em outros sites

entao cara, tira esse codigo do <?php } ?>

 

 

deu o seguinte erro:

 

Warning: include(config.php) [function.include]: failed to open stream: No such file or directory in /home/brteam18/public_html/estacionados/radiolol/clube/usuarios.php on line 2

Warning: include(config.php) [function.include]: failed to open stream: No such file or directory in /home/brteam18/public_html/estacionados/radiolol/clube/usuarios.php on line 2

Warning: include() [function.include]: Failed opening 'config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/brteam18/public_html/estacionados/radiolol/clube/usuarios.php on line 2

Warning: mysql_query() [function.mysql-query]: Access denied for user 'brteam18'@'localhost' (using password: NO) in /home/brteam18/public_html/estacionados/radiolol/clube/usuarios.php on line 3

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/brteam18/public_html/estacionados/radiolol/clube/usuarios.php on line 3

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/brteam18/public_html/estacionados/radiolol/clube/usuarios.php on line 4

Quer aparecer? Cadastre-se!

Compartilhar este post


Link para o post
Compartilhar em outros sites

isso eh erro na ta pag config.php, erro na conexao com o banco de dados, ve se esta certinho os dados..

 

Amigo, obrigado, vocÇê me lembrou, eu só estava usando o arquivo conexao.php e esse estava requerendo o config.php , logo então copiei o conexao.php e renomei-o como config.php e deu certo!

 

bom resolvemos esse problema, agora estou com um probleminha na usuarios2, veja o erro:

 

erro:

Parse error: syntax error, unexpected $end in /home/brteam18/public_html/estacionados/radiolol/clube/usuarios2.php on line 68

 

código da página:

<?php
$i = 0;?>
<?php
include "config.php";
$SQLquery = "SELECT * FROM top10 order by votos desc LIMIT 8";
$SQLresult = mysql_query($SQLquery,$conecta);
while ($linhas = mysql_fetch_array($SQLresult)){
$id = $linhas["id"];
$foto = $linhas["foto"];
$musica = $linhas["musica"];
$artista = $linhas["artista"];
$n = $i+1;
$i++;
?>
<style type="text/css">
<!--
img {
   border: 0px;
}
a:link {
color: #FFFFFF; 
text-decoration: none;
}
.style1 {font-family: Tahoma}
.style2 {font-size: 9px}
.style5 {font-style: italic}
body {
background-color: #FFFFFF;
}
-->
</style>


											<table width="150" height="113" border="0" cellpadding="0" cellspacing="0">
                                                 <tr>
                                                   <td><table width="247" border="0" cellspacing="0" cellpadding="0">
                                       <tr>
                                                         <td width="101"><div align="center">
                                                           <table width="100" border="0" cellspacing="0" cellpadding="0">
                                                             <tr>
                                                               <td><em><span class="box_05_3_2_1_2" style="cursor:pointer;"><img src="<? echo $foto ?>" width="95" height="110" class="box_05_3_2_1_2_1"/></span></em></td>
                                                             </tr>
                                                           </table>
                                                         </div></td>
                                         <td width="146" class="style5"><table width="147" border="0" cellspacing="0" cellpadding="0">
                                     <tr>
                                                               <td width="147"><span class="box_05_3_2_1_2 style1 style2" style="cursor:pointer;"><strong>N</strong>ome: <strong><? echo $nome ?></strong></span></td>
                                           </tr>
                                                             <tr>
                                                               <td><span class="box_05_3_2_1_2 style1 style2" style="cursor:pointer;"><strong>I</strong>dade:<strong> <? echo $nascimento ?></strong></span></td>
                                           </tr>
                                                             <tr>
                                                               <td><span class="box_05_3_2_1_2 style1 style2" style="cursor:pointer;"><strong>Ci</strong>dade:<strong> <? echo $cidade ?> / <span class="box_05_3_2_1_2 style1 style2" style="cursor:pointer;"><? echo $estado ?></span></strong></span></td>
                                           </tr>
                                                             <tr>
                                                               <td><span class="box_05_3_2_1_2 style1 style2" style="cursor:pointer;"><strong>B</strong>airro: <? echo $bairro ?></span></td>
                                           </tr>
                                                             <tr>
                                                               <td><a href='http://www.orkut.com<? echo $orkut ?>'><img src="../../images/orkut.png"></a><a href='skype:?add=<? echo $skype ?>'><img src="../../images/skype.png"></a><a href='msnim:add?contact=<? echo $msn ?>'><img src="../../images/msn.png"></a></td>
                                           </tr>
                                                             <tr>
                                                               <td> <div align="center"></div></td>
                                           </tr>
                                         </table></td>
                                                     </tr>
                                                   </table></td>
                                                 </tr>
                                               </table>

linha do erro:

</table>

Compartilhar este post


Link para o post
Compartilhar em outros sites

esse erro ocorre quando há um fecha-chave (}) faltando

verifique se toda a chave aberta possui um fechamento correspondente

Resolvido!

 

Falta fechar o while

Resolvido, obrigado!

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.