Skip to content

Commit b5223dc

Browse files
committed
up
1 parent 3e71d0d commit b5223dc

11 files changed

Lines changed: 206 additions & 20 deletions

File tree

2code_php/5.php

Whitespace-only changes.

2code_php/add.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
$c = isset($_GET["c"]) ? $_GET["c"]: '';
66
$a = isset($_GET["a"]) ? $_GET["a"] : '';
77
$n = isset($_GET["n"]) ? $_GET["n"]: '';
8-
8+
session_start();
9+
if ($_SESSION['code']!=$u) {
10+
exit('非法操作!');
11+
}
912

1013
// 连主库
1114
$conn = mysqli_connect('w.rdc.sae.sina.com.cn'.':'.'3306','kzl3w535lm','1313mzj34mi1x05z5k3imj1k2j13m2w2hykl1ziz','app_jxjweb');
@@ -18,12 +21,16 @@
1821

1922
$sql="INSERT INTO `app_jxjweb`.`2code_code` (`id`, `user`, `num`, `content`, `address`, `address_id`, `name`) VALUES (NULL, '".$u."', '1', '".$c."', '".$a."', '', '".$n."')";
2023

24+
25+
2126
$result = $conn->query($sql);
2227

2328
class Verify {
2429
public $code = '00';
2530
}
2631
$verify = new Verify();
32+
33+
// var_dump($result);
2734
if ($result){
2835
$verify->code = 1;
2936
}else{

2code_php/content.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
header("Access-Control-Allow-Origin: *");
33
$u = isset($_GET["u"]) ? $_GET["u"] : '';
44
// 连主库
5+
session_start();
6+
if ($_SESSION['code']!=$u) {
7+
exit('非法操作!');
8+
}
59
$conn = mysqli_connect('w.rdc.sae.sina.com.cn'.':'.'3306','kzl3w535lm','1313mzj34mi1x05z5k3imj1k2j13m2w2hykl1ziz','app_jxjweb');
610

711
// Check connection

2code_php/delete.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
header("Access-Control-Allow-Origin: *");
4+
$u = isset($_GET["u"]) ? $_GET["u"] : '';
5+
$i = isset($_GET["i"]) ? $_GET["i"]: '';
6+
session_start();
7+
if ($_SESSION['code']!=$u) {
8+
exit('非法操作!');
9+
}
10+
11+
// 连主库
12+
$conn = mysqli_connect('w.rdc.sae.sina.com.cn'.':'.'3306','kzl3w535lm','1313mzj34mi1x05z5k3imj1k2j13m2w2hykl1ziz','app_jxjweb');
13+
14+
// Check connection
15+
if ($conn->connect_error) {
16+
die("连接失败: " . $conn->connect_error);
17+
}
18+
19+
$sql="DELETE FROM `app_jxjweb`.`2code_code` WHERE `2code_code`.`id` = '".$i."' AND `2code_code`.`user` ='".$u."'";
20+
21+
$result = $conn->query($sql);
22+
23+
class Verify {
24+
public $code = '00';
25+
}
26+
$verify = new Verify();
27+
// var_dump($result);
28+
if ($result){
29+
$verify->code = 1;
30+
}else{
31+
$verify->code = 0;
32+
}
33+
echo json_encode($verify);
34+
mysqli_close($conn);
35+
$conn->close();
36+
?>

2code_php/fix.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
header("Access-Control-Allow-Origin: *");
4+
$u = isset($_GET["u"]) ? $_GET["u"] : '';
5+
$c = isset($_GET["c"]) ? $_GET["c"]: '';
6+
$a = isset($_GET["a"]) ? $_GET["a"] : '';
7+
$n = isset($_GET["n"]) ? $_GET["n"]: '';
8+
$i = isset($_GET["i"]) ? $_GET["i"]: '';
9+
session_start();
10+
if ($_SESSION['code']!=$u) {
11+
exit('非法操作!');
12+
}
13+
// 连主库
14+
$conn = mysqli_connect('w.rdc.sae.sina.com.cn'.':'.'3306','kzl3w535lm','1313mzj34mi1x05z5k3imj1k2j13m2w2hykl1ziz','app_jxjweb');
15+
16+
// Check connection
17+
if ($conn->connect_error) {
18+
die("连接失败: " . $conn->connect_error);
19+
}
20+
21+
22+
$sql="UPDATE `app_jxjweb`.`2code_code` SET `content` = '".$c."',
23+
`address` = '".$a."',
24+
`name` = '".$n."' WHERE `2code_code`.`id` ='".$i."' AND `2code_code`.`user` ='".$u."'";
25+
26+
27+
28+
$result = $conn->query($sql);
29+
30+
class Verify {
31+
public $code = '00';
32+
}
33+
$verify = new Verify();
34+
35+
// var_dump($result);
36+
if ($result){
37+
$verify->code = 1;
38+
}else{
39+
$verify->code = 0;
40+
}
41+
echo json_encode($verify);
42+
mysqli_close($conn);
43+
$conn->close();
44+
?>

2code_php/img.php

Lines changed: 0 additions & 3 deletions
This file was deleted.

2code_php/login.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
header("Access-Control-Allow-Origin: *");
44
$u = isset($_GET["u"]) ? $_GET["u"] : '';
55
$p = isset($_GET["p"]) ? $_GET["p"]: '';
6-
6+
session_start();
77

88

99
// 连主库
@@ -25,7 +25,7 @@ class Verify {
2525
$verify->user = $u;
2626

2727
if ($result->num_rows > 0){
28-
$_SESSION['true'] = $true;
28+
$_SESSION['code'] = $u;
2929
$verify->code = 1;
3030
}else{
3131
$verify->code = 0;

2code_php/url.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
header("Access-Control-Allow-Origin: *");
3+
$id = isset($_GET["id"]) ? $_GET["id"] : '';
4+
// 连主库
5+
$conn = mysqli_connect('w.rdc.sae.sina.com.cn' . ':' . '3306', 'kzl3w535lm', '1313mzj34mi1x05z5k3imj1k2j13m2w2hykl1ziz', 'app_jxjweb');
6+
// Check connection
7+
if ($conn->connect_error) {
8+
die("连接失败: " . $conn->connect_error);
9+
}
10+
$sql = "SELECT * FROM `2code_code` WHERE id = '" . $id . "'";
11+
$result = $conn->query($sql);
12+
if (mysqli_num_rows($result) > 0) {
13+
while ($row = mysqli_fetch_assoc($result)) {
14+
if (!strpos($row["content"], "//")) {
15+
$k = "//" . $row["content"];
16+
} else {
17+
$k = $row["content"];
18+
}
19+
$v=$row["num"]+1;
20+
$sql = "UPDATE `app_jxjweb`.`2code_code` SET `num` = '".$v."' WHERE `2code_code`.`id` = '".$id."'";
21+
$result2 = $conn->query($sql);
22+
Header("HTTP/1.1 303 See Other");
23+
Header("Location: $k");
24+
}
25+
} else {
26+
exit('错误路径!');
27+
}
28+
// Header("Location:$result");
29+
30+
?>
31+

2code_web/css/templatemo-style.css

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ http://www.templatemo.com/tm-509-hydro
877877
margin: 15px 0 15px 0;
878878
height: 50px;
879879
background: #fcf8e3;
880-
color: #fff;
880+
color: #111;
881881
}
882882

883883
.modal-dialog form .form-control:hover,
@@ -1068,7 +1068,12 @@ http://www.templatemo.com/tm-509-hydro
10681068

10691069
#contact #add_code,
10701070
#delete_code,
1071-
#fix_code {
1071+
#fix_code {
10721072
background: #ce3232;
10731073
color: #fff;
1074+
}
1075+
1076+
#login_btn {
1077+
background: red;
1078+
color: #fff;
10741079
}

2code_web/index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
<div class="home-info">
5858
<h1>二维码活码管理系统</h1>
5959
<a href="javascript:void(0)" class="btn section-btn smoothScroll user user_name">用户</a>
60+
<a href="javascript:exit()" class="btn section-btn smoothScroll user">退出</a>
6061
<span>
6162
成聚移动二维码管理系统
6263
<small>简单、高效的移动营销工具,稳定、可靠的二维码管理系统,实现二维码先印后改。</small>
@@ -181,9 +182,9 @@ <h2>管理</h2>
181182
</div>
182183
<div role="tabpanel" class="tab-pane fade in" id="sign_in">
183184
<form >
184-
<input type="text" autocomplete="off" class="form-control" name="name" placeholder="名称" required>
185-
<input type="text" autocomplete="off" class="form-control" name="url" placeholder="路径" required>
186-
<input type="text" autocomplete="off" class="form-control" name="address" placeholder="区域" required>
185+
<input type="text" id="fix_name" autocomplete="off" class="form-control" name="name" placeholder="名称" required>
186+
<input type="text" id="fix_url" autocomplete="off" class="form-control" name="url" placeholder="路径" required>
187+
<input type="text" id="fix_address" autocomplete="off" class="form-control" name="address" placeholder="区域" required>
187188
<input type="button" id="fix_code" class="form-control" name="submit" value="确定">
188189
<input type="button" id="delete_code" class="form-control" name="submit" value="删除">
189190
</form>

0 commit comments

Comments
 (0)