-
Notifications
You must be signed in to change notification settings - Fork 0
/
Join_Check.php
36 lines (31 loc) · 1.15 KB
/
Join_Check.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
<?php
// Check if the form is submitted
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// Get the user inputs from the form
$rfemail = $_POST["reference-email"];
$to = $_POST["invited-email"];
$referenceCode = $_POST["reference-code"];
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "Kanban_Board";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Prepare and execute the SQL query to check for a match
$sql = "SELECT * FROM joinTable WHERE Admin_Email = '$rfemail' AND Invited_Email = '$to' AND ReferenceCode = '$referenceCode'";
$result = $conn->query($sql);
// Check if there is a match
if ($result->num_rows > 0) {
// Match found, redirect to another page
header("Location: board\board.html");
exit;
} else {
// No match found, you can handle this case, e.g., display an error message
echo "No matching records found.";
}
// Close the database connection
$conn->close();
}
?>