删除页面无效

时间:2013-07-03 11:54:08

标签: php mysql content-management-system

我正在创建一个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 Parse错误:语法错误,第37行/delete.php中的意外T_ELSE

第37行是“}其他{”请有人告诉我哪里出错了?

谢谢你。

1 个答案:

答案 0 :(得分:2)

您的php开启标记无效。改变

< php } ?>

<?php } ?>