【发布时间】:2013-07-03 11:54:07
【问题描述】:
我正在创建一个 cms,并且已经完美地设置了所有页面,但删除页面除外。
我的 delete.php 有这个代码:
<?php
session_start();
include_once('../include/connection.php');
include_once('../include/article.php');
$article = new Article;
if (isset($_SESSION['logged_in'])) {
$articles = $article->fetch_all();
?>
<html>
<head>
<title>testing</title>
<link rel="stylesheet" href="../style.css" />
</head>
<body>
<div class="container">
<a href="index.php" id="logo">CMS</a>
<br /><br />
<form action="delete.php" method="get">
<select onchange="this.form.submit();">
<?php foreach ($articles as $article){ ?>
<option value="<?php echo $article['article_id']; ?>"><?php echo $article['article_title']; ?></option>
<php } ?>
</select>
</form>
</div>
</body>
</html>
<?php
} else {
header('Location: index.php');
}
?>
但在我的错误日志中它告诉我:
PHP 解析错误:语法错误,第 37 行 /delete.php 中的意外 T_ELSE
第 37 行是“} else {”请有人告诉我哪里出错了?
谢谢。
【问题讨论】:
-
<php } ?>应该是<?php } ?> -
这个问题似乎离题了,因为它太本地化了。
-
<php } ?>缺少? -
谢谢大家的帮助。
标签: php mysql content-management-system