-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb_fun.php
More file actions
64 lines (54 loc) · 1.88 KB
/
db_fun.php
File metadata and controls
64 lines (54 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
class db_log
{
public $connect;
public $select;
function __construct() {
include('config_global.php');
$connect = mysql_connect($global_db_server,$global_db_username,$global_db_pwd);
if($connect)
{
$select = mysql_select_db($global_db_db, $connect);
mysql_query("SET NAMES 'utf8'");
}
}
function __destruct() {
}
function new_article($action)
{
$userip=GetIP();
$action="narticle:".str_replace("\"","@",$action);
$action=str_replace("'","*",$action);
$sqlstr="INSERT INTO bmyuserlog(username,userip,action,usertime)VALUES ('".$_SESSION["userid"]."','".$userip."','".$action."','".date("Y-m-d H:i:s")."')";
mysql_query($sqlstr);
return true;
}
function huifu_article($action)
{
$userip=GetIP();
$action="harticle:".str_replace("\"","@",$action);
$action=str_replace("'","*",$action);
$sqlstr="INSERT INTO bmyuserlog(username,userip,action,usertime)VALUES ('".$_SESSION["userid"]."','".$userip."','".$action."','".date("Y-m-d H:i:s")."')";
mysql_query($sqlstr);
return true;
}
function save_debug($action)
{
$userip=GetIP();
$action="debug:".str_replace("\"","@",$action);
$action=str_replace("'","*",$action);
$action=iconv("GB2312","UTF-8//IGNORE",$action);
$sqlstr="INSERT INTO bmyuserlog(username,userip,action,usertime)VALUES ('".$_SESSION["userid"]."','".$userip."','".$action."','".date("Y-m-d H:i:s")."')";
mysql_query($sqlstr);
return true;
}
function save_login()
{
$userip=GetIP();
$action="login:";
$sqlstr="INSERT INTO bmyuserlog(username,userip,action,usertime)VALUES ('".$_SESSION["userid"]."','".$userip."','".$action."','".date("Y-m-d H:i:s")."')";
mysql_query($sqlstr);
return true;
}
}
?>