-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient_confirmation1.php
More file actions
57 lines (46 loc) · 1.61 KB
/
client_confirmation1.php
File metadata and controls
57 lines (46 loc) · 1.61 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Client Confirmation</title>
</head>
<body>
<?php
include('connect.php');
if(isset($_GET['id'])){
glob($a_ID = $_GET['id']);
$select = "SELECT * FROM client_sign_up WHERE id = $a_ID";
$sresult = $pdo->query($select);
while($value = $sresult->fetch()){
echo '
<form method="post">
<input type="text" value='.$value['username'].' name="user">
<input type="text" value='.$value['password'].' name="pass">
<input type="submit" value="Accept" name="send">
</form>
';
}
}
if(isset($_POST['send'])){
$user = $_POST['user'];
$pass = $_POST['pass'];
$sselect = "SELECT * FROM client_confi
455D
rmation WHERE username = '$user'";
$ssresult = $pdo->query($sselect);
$num = $ssresult->fetchColumn();
if($num > 0){
echo "Exist";
}
else{
$insert = "INSERT INTO client_confirmation VALUES($a_ID, '$user', '$pass')";
$iresult = $pdo->query($insert);
if($iresult){
$dqr = "DELETE FROM client_sign_up WHERE id = $a_ID";
$dresult = $pdo->query($dqr);
header('location:dashboard2.php');
}
}
}
?>
</body>
</html>