geovanepc 0 Posted Monday at 04:25 AM Report Share Posted Monday at 04:25 AM Boa noite colegas. Sou leigo em PHP e estou com um problema em um código, Ficarei grato se alguém puder me ajudar! O trecho de código abaixo está me retornando o seguinte error: ( ! ) Parse error: syntax error, unexpected end of file in C:\wamp\www\news\noticias.php on line 49 Segue o código: <?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> Quote Link to post Share on other sites
Question
geovanepc 0
Boa noite colegas.
Sou leigo em PHP e estou com um problema em um código,
Ficarei grato se alguém puder me ajudar!
O trecho de código abaixo está me retornando o seguinte error:
Segue o código:
<?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>
Link to post
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.