-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContact_form.php
More file actions
57 lines (41 loc) · 1.06 KB
/
Copy pathContact_form.php
File metadata and controls
57 lines (41 loc) · 1.06 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>
<head>
<title></title>
</head>
<body>
<?php
session_start();
function function_alert($message) {
// Display the alert box
echo "<script>alert('$message');</script>";
}
$con = mysqli_connect('sql303.epizy.com','epiz_28396763','x5N5ldvRxWvo');
mysqli_select_db($con,'epiz_28396763_WanglePC');
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$subject = $_POST['subject'];
$username = $_POST['username'];
$s = " select * from Contact_form where firstname = '$username'";
$result = mysqli_query($con,$s);
$num = mysqli_num_rows($result);
if($num == 1)
{
$message = "You Response was already submited";
echo "<script>
alert('$message');
window.location.href='index.html';
</script>";
}else
{
$reg="insert into Contact_form(firstname , lastname , subject , username) values ('$firstname','$lastname','$subject','$username')";
mysqli_query($con, $reg);
$message = "Thanku For Your Response";
echo "<script>
alert('$message');
window.location.href='index.html';
</script>";
}
?>
</body>
</html>