Skip to content

Commit b04a127

Browse files
authored
Merge pull request #8 from YComputer/master
database
2 parents 00797f6 + 91cff4c commit b04a127

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
sqlite3 查看表结构
22
select * from sqlite_master where type="table" and name="emperors";
33

4-
user
4+
users
55
CREATE TABLE users(userid integer primary key autoincrement, name varchar(512) not null, email varchar(512) not null, pwd varchar(512) not null, role integer not null);
66
INSERT INTO users (name, email, pwd, role) VALUES ('admin', '[email protected]', 'pwd', 0);
77
INSERT INTO users (name, email, pwd, role) VALUES ('normal', '[email protected]', 'pwd', 1);
8+
9+
orders 表
10+
pid用-分割,qty也用-分割,123-456;1-2;表示购买的产品pid是123和456,数量分别是1个和两个。status,表示这个订单状态。0 未支付,1支付成功。
11+
CREATE TABLE orders(orderid integer primary key autoincrement, pid varchar(512) not null, qty varchar(512) not null, userid integer not null, hash varchar(512) not null, status integer not null);
12+
INSERT INTO orders (pid, qty, userid, hash, status) VALUES ('1-2', '1-1', 1, 'product hash', 1);
13+
14+
815
// sql 注入攻击
916
$sql = "SELECT * FROM users WHERE name='{$_POST['name']}' AND pwd='{$_POST['pwd']}'";
1017
// 用户注入
@@ -41,4 +48,6 @@ key words: context-dependent, context-aware, context-sensitive, Auto-Escape
4148
https://security.googleblog.com/2009/03/reducing-xss-by-way-of-automatic.html
4249

4350

44-
注意修改:application/conrollers/Upload.php 中静态的文件存储路径。
51+
注意修改:application/conrollers/Upload.php 中静态的文件存储路径。
52+
53+
xss 和 sql 注入 警告

application/database/data.sq3

1 KB
Binary file not shown.

application/views/layout_main.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<title>Phase 1</title>
1111
<link href="./public/css/bootstrap.min.css" rel="stylesheet">
1212
<link href="./public/css/index.css" rel="stylesheet">
13-
<script src="http://github.com/%3Cspan%20class="x x-first x-last">http://libs.baidu.com/jquery/2.1.1/jquery.min.js"></script>
13+
<script src="http://github.com/%3Cspan%20class="x x-first x-last">./public/js/jquery.min.js"></script>
1414
<script src="./public/js/bootstrap.min.js"></script>
1515
</head>
1616
<body>

0 commit comments

Comments
 (0)