-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest2.php
More file actions
28 lines (20 loc) · 792 Bytes
/
test2.php
File metadata and controls
28 lines (20 loc) · 792 Bytes
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
<title>iTHome_Test</title>
<meta http-equiv="content-type" charset="UTF-8" />
<?php
$db = new mysqli("localhost","root", "", "member");
if ($db->connect_error) {
die('無法連上資料庫:' . $db->connect_error);
}
$db->set_charset("utf8");
$get_account=htmlspecialchars($_POST["account"]);
$get_password=htmlspecialchars($_POST["password"]);
/*$get_value3=htmlentities($_POST["carousel"],ENT_QUOTES,"UTF-8");
echo "值:".$get_value3;*/
$sql = "INSERT INTO user(user_name, user_pass) VALUES ('$get_account','$get_password')";
if (mysqli_query($db, $sql)) {
echo "<br> New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($db);
}
mysqli_close($db);
?>