当前位置:Gxlcms > PHP教程 > 求依照CI框架分离html页面

求依照CI框架分离html页面

时间:2021-07-01 10:21:17 帮助过:6人阅读

求按照CI框架分离html页面
在网上找了一个移序的功能,但是代码是php、mysql、html混搭的,现在用的是CI框架,刚接触框架不久,不会分离,请各位帮忙照着CI框架的模式分离这个页面
数据库页面:class_moder.php
处理页面:admin.php
html页面:sort.html






实现新闻的上移下移功能





header("Content-type:text/html;charset=gb2312");
include("mysql.class.php");
$conn=new mysql("localhost","root","root","test"," ","gbk");
if(!emptyempty($_GET["weight"])){
if($_GET["move"]=="up"){
//获取上一条新闻信息
$query=$conn->query("select * from `article` where `weight` > '$_GET[weight]' order by `weight` asc limit 1");
if($conn->db_num_rows(query)>0){
$rows=$conn->fetch_array($query);
$conn->query("update `article` set `weight`='$rows[weight]' where `weight`='$_GET[weight]'");
$conn->query("update `article` set `weight`='$_GET[weight]' where `ID`='$rows[ID]'");
}else{
echo "";
}
}else if($_GET["move"]=="down"){
//获取下一条新闻信息
$query=$conn->query("select * from `article` where `weight` < '$_GET[weight]' order by `weight` desc limit 1");
if($conn->db_num_rows(query)>0){
$rows=$conn->fetch_array($query);
$conn->query("update `article` set `weight`='$rows[weight]' where `weight`='$_GET[weight]'");
$conn->query("update `article` set `weight`='$_GET[weight]' where `ID`='$rows[ID]'");
}else{
echo "";
}
}
}
?>



人气教程排行

文章上下移动
ID标题移动