【问题标题】:delete page is not working [closed]删除页面不起作用[关闭]
【发布时间】: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 {”请有人告诉我哪里出错了?

谢谢。

【问题讨论】:

  • &lt;php } ?&gt; 应该是&lt;?php } ?&gt;
  • 这个问题似乎离题了,因为它太本地化了。
  • &lt;php } ?&gt; 缺少?
  • 谢谢大家的帮助。

标签: php mysql content-management-system


【解决方案1】:

您的 php 开始标签无效。改变

< php } ?>

<?php } ?>

【讨论】:

  • 非常感谢。这很好用。我应该已经看到了(教科书错误)。感谢您的帮助。
猜你喜欢
  • 1970-01-01
  • 2015-06-09
  • 1970-01-01
  • 2013-03-06
  • 2019-01-30
  • 2013-09-28
  • 1970-01-01
  • 2016-09-21
  • 1970-01-01
相关资源
最近更新 更多