fsales_123 1 Denunciar post Postado Agosto 13, 2015 como eu arrumo? Parse error: syntax error, unexpected $end in C:\xampp\htdocs\news\noticias.php on line 50 linha 50 leia mais Compartilhar este post Link para o post Compartilhar em outros sites
William Bruno 1501 Denunciar post Postado Agosto 13, 2015 Poste o código php, da linha 30 até a 51, pelo menos. Compartilhar este post Link para o post Compartilhar em outros sites
fsales_123 1 Denunciar post Postado Agosto 13, 2015 código todo! <?php @header( 'Content-Type: text/html; charset=iso-8859-1' ); require_once 'database/mysql.php'; $db = new Mysql; ?> <!DOCTYPE html> <html> <head> <title>News</title> <link href="css/home.css" rel="stylesheet"> <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet"> <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script> </head> <body> <div id="news" class="span12"> <?php //$db->url = 'noticias.php'; $db->paginate(4); $db->query("select * from noticia order by noticia_id desc")->fetchAll(); if ($db->rows >= 1): $news = $db->data; foreach ($news as $new): $n = (object) $new; $n->noticia_content_cut = $db->cut($n->noticia_content, 300, '...'); if ($n->noticia_foto == "" || strlen($n->noticia_foto) <= 1): $n->noticia_foto = "images/nopic.png"; else : $n->noticia_foto = "thumb.php?img=fotos/$n->noticia_foto"; endif; ?> <div class="media"> <a class="pull-left" href="noticia.php?id=<?= $n->noticia_id ?>"> <img src="<?= $n->noticia_foto ?>" class="media-object img-polaroid" /> </a> <div class="media-body"> <h4 class="media-heading"><?=$n->noticia_title ?></h4> <p><small><?=$n->noticia_content_cut ?> <em><a href="noticia.php?id=<?= $n->noticia_id ?>" class="btn btn-link">leia mais</a></em></small> </div> </div> <hr /> <? endforeach; echo $db->link; endif; ?> </div> </body> </html> Compartilhar este post Link para o post Compartilhar em outros sites
Beraldo 864 Denunciar post Postado Agosto 13, 2015 Esse erro ocorre quando há um caractere de fechamento ausente, como uma chave (}) por exemplo. Explico esse erro neste link: http://rberaldo.com.br/as-mensagens-de-erros-mais-comuns-do-php/#unexpected_end No seu caso, tem dois if's, mas só um endif Compartilhar este post Link para o post Compartilhar em outros sites
lokaodomau 61 Denunciar post Postado Agosto 13, 2015 Identação ajuda. Ajuda o quê? Ajuda a se localizar melhor Como faço para identar? Geralmente com TAB. Acho que entendi. Sim, entendi. Compartilhar este post Link para o post Compartilhar em outros sites