Php 管理面板在页脚下方显示编辑 post 表单
Php Admin Panel displays Edit post form below the footer
所以我按照 Php 的 CMS 教程制作了这个很棒的网站,
我正在为一所学校制作这个网站,这是我的第一个动态网站。
所以我创建了一个看起来像这样的管理面板。
Admin Panel
看起来很酷吧?
实际上,我按照教程制作了一个基本的管理面板,现在我已将代码迁移到一个很棒的管理面板主题,并且我现在已将我的代码移至 admin2。
当我单击视图 post 时,它会在获取全局数组中放置一个变量 "view"。
<a href="index.php?view=view">
此视图变量在同一 index.php 页面中有一个代码。
<?php if (isset($_GET['view'])){
//My form and loop to get data from database and display here
}
?>
但是为了编辑 post,我有一个单独的文件,它从 index.php
中捕获以下代码
<td><a href= "edit.php?edit=<?php echo $id;?>">Edit</a></td>
这是一个 table 数据,出现在我上面提到的相同 if(isset) 条件中。
在我的 edit.php 文件中,我有代码来更新用户点击的相同 table 的数据。
<?php
include 'index.php';
//Update code and form
?>
现在我的页面是这样显示的
AdminPanel display problem
我可以看到我的 table 显示在页脚区域下方,因为我将索引放在此表单代码的正上方。
如何将这段代码添加到右边的空白区域。
在您的 index.php 页面上试试这个
//Check for edit same place as you are checking view
<?php if (isset($_GET['edit'])){
include 'edit.php?edit='.$_GET['edit'];
}
?>
所以我按照 Php 的 CMS 教程制作了这个很棒的网站, 我正在为一所学校制作这个网站,这是我的第一个动态网站。 所以我创建了一个看起来像这样的管理面板。
Admin Panel
看起来很酷吧? 实际上,我按照教程制作了一个基本的管理面板,现在我已将代码迁移到一个很棒的管理面板主题,并且我现在已将我的代码移至 admin2。 当我单击视图 post 时,它会在获取全局数组中放置一个变量 "view"。
<a href="index.php?view=view">
此视图变量在同一 index.php 页面中有一个代码。
<?php if (isset($_GET['view'])){
//My form and loop to get data from database and display here
}
?>
但是为了编辑 post,我有一个单独的文件,它从 index.php
中捕获以下代码<td><a href= "edit.php?edit=<?php echo $id;?>">Edit</a></td>
这是一个 table 数据,出现在我上面提到的相同 if(isset) 条件中。
在我的 edit.php 文件中,我有代码来更新用户点击的相同 table 的数据。
<?php
include 'index.php';
//Update code and form
?>
现在我的页面是这样显示的
AdminPanel display problem
我可以看到我的 table 显示在页脚区域下方,因为我将索引放在此表单代码的正上方。 如何将这段代码添加到右边的空白区域。
在您的 index.php 页面上试试这个
//Check for edit same place as you are checking view
<?php if (isset($_GET['edit'])){
include 'edit.php?edit='.$_GET['edit'];
}
?>