forked from zhaobod1/QDadvertorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsavevip.php
executable file
·59 lines (51 loc) · 2.04 KB
/
savevip.php
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
<?php ob_start(); ?>
<?php
header("Content-Type: text/html; charset=utf-8");
include("include/config.php");
?>
<?php
$action = @$_REQUEST["action"];
$flag = $_REQUEST["flag"];//3,初级代理,2中级代理,1高级代理
$qq = $_REQUEST["qq"];
$dianhua = $_REQUEST["tel"];
$weburl = $_REQUEST["web"];
$myemail = $_REQUEST["email"];
switch ($action) {
case "add":
$VipUser = $_REQUEST["user"];
$VipPass = md5(@$_REQUEST["pass1"]);
$regtime = date("Y-m-d h:i:s");
$data = date("Y-m-d h:i:s");
$sql = "select * from user where VipUser='" . $VipUser . "'";
$result = mysql_db_query($dbname, $sql);
//mysql_select_db($dbname);
//$result=mysql_query($sql);
$rs = mysql_fetch_array($result);
if ($rs == NULL) {
$sql = "insert into user (VipUser,VipPass,qq,dianhua,weburl,myemail,flag,regtime) values ('" . $VipUser . "','" . $VipPass . "','" . $qq . "','" . $dianhua . "','" . $weburl . "','" . $myemail . "'," . $flag . ",'" . $regtime . "')";
mysql_db_query($dbname, $sql);
//mysql_select_db($dbname);
//$result=mysql_query($sql);
$ip = ($_SERVER["HTTP_VIA"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] : $_SERVER["REMOTE_ADDR"];
$ip = ($ip) ? $ip : $_SERVER["REMOTE_ADDR"];
setcookie('ckey', "yes");
setcookie('VipUser', $VipUser);
setcookie('fg', $flag);
setcookie('ips', $ip);
setcookie('dt', $data);
/*王庆路 注册完毕跳转到首页*/
echo "<script>alert('注册成功!');location.href='/system/denglu.php';</script>";
/*王庆路 注册完毕跳转到首页 end*/
} else {
echo "<script>alert('用户已存在!');history.go(-1);</script>";
}
break;
case "save":
$ID = $_REQUEST["ID"];
$headpic = $_REQUEST["headpic"];
$sql = "update user set qq='" . $qq . "',dianhua='" . $dianhua . "',weburl='" . $weburl . "',myemail='" . $myemail . "',headpic='" . $headpic . "',flag=" . $flag . " where ID=" . $ID . "";
mysql_db_query($dbname, $sql);
echo "<script>alert('修改成功!');location.href='viplist.php';</script>";
break;
}
?>