-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnect3.php
More file actions
54 lines (39 loc) · 1.02 KB
/
Copy pathconnect3.php
File metadata and controls
54 lines (39 loc) · 1.02 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
<!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());
}
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$subject = $_REQUEST['subject'];
$message = $_REQUEST['message'];
$sql = "INSERT INTO contact_us VALUES ('$name',
'$email','$subject','$message')";
if(mysqli_query($conn, $sql)){
$_SESSION['status']="Data Inserted Successfully";
header('location: index.php');
/* echo "<h1>DATA STORED SUCCESSFULLY !"
. " </h1>";
echo nl2br("\n$name\n $email\n "
. "$subject\n $message\n ") */;
} 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>