⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 func.php

📁 php蓝狐文章管理系统
💻 PHP
字号:
<?
require "./inc/config.php";
function mscon()
{  
  global $host,$database_usn,$database_pwd;
  @mysql_connect("$host","$database_usn","$database_pwd") or die("对不起,数据库连接错误!请稍候再来,或与管理员联系");
}
function check_login()
{  global $sess;
 if(!session_is_registered("sess_0230a09a07cab1df8112d00b1f9a9719"))
   {
    if($sess_0230a09a07cab1df8112d00b1f9a9719!=$sess)
       {
         redir("login.php");
         exit;
       }
   }
}
function redir($addr)
  {
    header("location:$addr");
   }
function add_article()
{
   global $database,$table,$title,$cont,$type,$html;
   $dat=date(Y年m月d日);
   $title=htmlspecialchars($title);
   $query="insert into $table(title,cont,type,time,html) values('$title','$cont','$type','$dat','$html')";
   $res=mysql_db_query("$database",$query);
   if(!$res)
   echo mysql_error();
}
function add_hits($id)
{
global $database,$table;
 $query="update $table set hits=hits+1 where id=$id";
   $res=mysql_db_query("$database",$query);
}
function add_comm($id)
{
 global $database,$table;
 $query="update $table set comm=1 where id=$id";
   $res=mysql_db_query("$database",$query);
}
function un_comm($id)
{
 global $database,$table;
 $query="update $table set comm='0' where id=$id";
   $res=mysql_db_query("$database",$query);
}
function add_lock($id)
{
 global $database,$table;
 $query="update $table set locked='1' where id=$id";
   $res=mysql_db_query("$database",$query);
}

function un_lock($id)
{
 global $database,$table;
 $query="update $table set locked=0 where id=$id";
   $res=mysql_db_query("$database",$query);
}
function add_p_num($id)
{
 global $database,$table;
 $query="update $table set p_num=p_num+1 where id=$id";
   $res=mysql_db_query("$database",$query);
}
function add_del($id)
{
 global $database,$table;
 $query="delete from $table where id='$id'";
   $res=mysql_db_query("$database",$query);
}
 ?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -