-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateAccount.php
More file actions
41 lines (32 loc) · 965 Bytes
/
Copy pathupdateAccount.php
File metadata and controls
41 lines (32 loc) · 965 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
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
$id = $_POST["id"];
$pw = $_POST["pw"];
$hint = $_POST["hint"];
if($id==null || $pw==null || $hint==null){
echo "_GET ERROR<br>";
exit();
}
$host = 'localhost';//ip ÁÖ¼Ò
$user = 'wuddlaa';
$password = 'roqkfwk!2';
$dbName = 'wuddlaa';
$conn = mysqli_connect($host, $user, $password, $dbName); //µðºñ ¿¬°á¹× ¼±ÅÃ
if (!$conn) {
echo "Error: Unable to connect to MySQL." . PHP_EOL;
echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;
echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;
exit;
}
$sql = "UPDATE Pallet_Account SET pw='$pw',hint='$hint'WHERE id='$id';";
$result = mysqli_query($conn,$sql);
$data = array();
if($result){
$sql = "SELECT * FROM Pallet_Account WHERE id='$id' AND pw='$pw' AND hint='$hint';";
$result = mysqli_query($conn,$sql);
if(!$result)
echo json_encode($data["flag"] = "false");
else
echo json_encode($data["flag"] = "true");
}
mysqli_close($conn);
?>