我在显示我的帖子时遇到问题。
跑步:
- 阿帕奇版本。2.2.19 (Unix)
- PHP 版本 5.2.*
显示错误: “解析错误:语法错误,第 22 行出现意外的 T_STRING index.php”
下面是php脚本:
<?php
include('includes/connect_to_mysql.php');
?>
<?php include_once('functions/functions.php');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>magazin</title>
<link href="../style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
$posts = get_posts();
?>
<?php
foreach( $posts as $post){
<article>
<div class="three columns alpha thumbnail">
<figure><img src="images/<?php echo $post[`posts_id`]; ?>.jpg" alt="<?php echo $post[`posts_title`]; ?>" /></figure>
</div><!--three-->
<div class="seven columns omega">
<h2><a href = "single.php?id=<?php echo $post[`posts_id`]; ?>"><?php echo $post[`posts_title`]; ?></a></h2>
<p class="meta">Posted by<a href = "<?php echo $post[`posts_id`]; ?>"><?php echo $post[`posts_user`]; ?><?php echo $total_comments; ?></a></p>
<p><?php echo $post[`contents`]; ?></p>
</div><!--seven--><hr/>
</article><!--blog post-->
}
<?php
}
?>
</body>
</html>