-
Notifications
You must be signed in to change notification settings - Fork 0
/
out.php
81 lines (48 loc) · 1.87 KB
/
out.php
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
<?php
$servername = "";
$username = "root";
$password = "";
$dbname = "entry";
$conn = mysqli_connect($servername, $username, $password, $dbname) or die(" can't connect to server");
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
function check($input)
{
$input = trim($input);
$input = stripslashes($input);
$input = htmlspecialchars($input);
return $input;
}
$name = $email = $phone = $checkin = $checkout = "";
$phone = check($_POST["phone"]);
$checkout = date("d-M-Y H:i", time() + 19800);
$sql1 = "UPDATE entry SET checkout='$checkout' WHERE phone='$phone'";
if (mysqli_query($conn, $sql1) == TRUE) {
$sql1 = "select Name,email,emailh,phone,nameh From entry Where phone='$phone'";
$count = 0;
$result = $conn->query($sql1);
if ($row = $result->fetch_assoc()) {
$count++;
}
$name = $row['Name'];
$email = $row['email'];
$emailh = $row['emailh'];
$phone = $row['phone'];
$nameh = $row["nameh"];
$replysubject = "Innovaccer--Successful check-in ";
$replyfrom = "From: [email protected] \r\n";
$replymessage = "Hello there $nameh ,\r\n\r\n";
$replymessage .= "You Visiter has been succesfully checked out .\r\n
Visiter Name : '$name' \r\n Visiter email : '$email' \r\n Visiter phone : '$phone'";
$replymessage .= "All the Best !! \r\n\r\n";
$replymessage .= "<<This e-mail is automated, so please DO NOT reply>>\r\n";
mail($emailh, $replysubject, $replymessage, $replyfrom);
$messege = "Checkout is successfull";
echo "<script type='text/javascript'>alert('$messege');window.location.href='index.html';</script>";
echo " is registered Successfully ";
} else " error in registration ";