-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnect1.php
More file actions
41 lines (32 loc) · 866 Bytes
/
connect1.php
File metadata and controls
41 lines (32 loc) · 866 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
<!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());
}
$tno = $_REQUEST['tno'];
$dname = $_REQUEST['dname'];
$dphone = $_REQUEST['dphone'];
$table1 = "INSERT INTO dependent VALUES ($tno, '$dname','$dphone')";
if(mysqli_query($conn, $table1)){
$_SESSION['status']="Data Inserted Successfully";
header('location: adddependent.php');
} else{
echo "ERROR: Hush! Sorry $sql. "
. mysqli_error($conn);
}
;mysqli_close($conn);?>
<a href="index.php">
<button style="color:black; background-color:red;">ADMIN</button>
</a>
</center>
</body>
</html>