2016-10-22 54 views
0

因此,我创建了一个名为Php的CMS教程, 我创建了这个网站,这是我的第一个动态网站。 所以我创建了一个看起来像这样的管理面板。Php管理面板显示在页脚下方的编辑帖子表格

Admin Panel

看起来很酷吧? 其实我在教程后面做了一个基本的管理面板,现在我已经将代码迁移到一个很棒的管理面板主题,现在我已将代码移至admin2。 当我点击查看帖子时,它会在Get全局数组中放置一个变量“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 
} 
     ?>  

但是用于编辑后,我有捕捉从的index.php

<td><a href= "edit.php?edit=<?php echo $id;?>">Edit</a></td> 

这是存在于I”相同的,如果(isset)条件的表数据将以下代码一个单独的文件上面已经提到过。

在我的edit.php文件中,我有代码来更新用户点击过的同一张表的数据。

<?php 
include 'index.php'; 
//Update code and form 
?> 

现在我的页面显示如下。

AdminPanel display problem

我可以看到,因为我把指数在它右上方这种形式的代码,我的表显示在页脚区域下方。 我能做些什么来将此代码添加到正确的空白区域。

回答

0

试试这个index.php网页上

//Check for edit same place as you are checking view 
<?php if (isset($_GET['edit'])){ 
    include 'edit.php?edit='.$_GET['edit']; 
} 
     ?> 
+0

请让我知道,如果它的工作原理? –

+0

我要如何改变这一行 – JohnyHawkAhsan

+0

​​Edit JohnyHawkAhsan