-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnect5.php
More file actions
87 lines (60 loc) · 2.23 KB
/
Copy pathconnect5.php
File metadata and controls
87 lines (60 loc) · 2.23 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html>
<head>
<title>CONNECT PHP</title>
</head>
<body>
<center>
<?php
session_start();
$conn = mysqli_connect("localhost", "root", "", "apt_mgmt");
if($conn === false){
die("ERROR: Could not connect. "
. mysqli_connect_error());
}
$tname = $_REQUEST['tname'];
$aptno=$_REQUEST['aptno'];
$tno = $_REQUEST['tno'];
$tphone = $_REQUEST['tphone'];
$type = $_REQUEST['type'];
$block = $_REQUEST['block'];
$dname = $_REQUEST['dname'];
$dphone = $_REQUEST['dphone'];
$table1="update tenant set TNAME = '$tname' where TNO = '$tno'";
$table2="update tenant set TPHONE = '$tphone' where TNO = '$tno'";
$table3="update apartment set TYPE = '$type' where TNO = '$tno'";
$table4="update apartment set BLOCK = '$block' where TNO = '$tno'";
$table5="update dependent set DNAME = '$dname' where TNO = '$tno'";
$table6="update dependent set DPHONE = '$dphone' where TNO = '$tno'";
if(mysqli_query($conn, $table1)){
$_SESSION['status']="Data Updated Successfully";
header('location: Update.php');
}
if(mysqli_query($conn, $table2)){
$_SESSION['status']="Data Updated Successfully";
header('location: Update.php');
}
if(mysqli_query($conn, $table3)){
$_SESSION['status']="Data Updated Successfully";
header('location: Update.php');
}
if(mysqli_query($conn, $table4)){
$_SESSION['status']="Data Updated Successfully";
header('location: Update.php');
}
if(mysqli_query($conn, $table5)){
$_SESSION['status']="Data Updated Successfully";
header('location: Update.php');
}
if(mysqli_query($conn, $table6)){
$_SESSION['status']="Data Updated Successfully";
header('location: Update.php');
}
;mysqli_close($conn);
?>
<a href="index.php">
<button style="color:green">ADMIN</button>
</a>
</center>
</body>
</html>