This commit is contained in:
Andrew Trieu
2023-02-10 19:20:34 +02:00
parent c717c9e4c1
commit 5f98bab91e
23 changed files with 586 additions and 325 deletions

17
php/search.php Normal file
View File

@@ -0,0 +1,17 @@
<?php
session_start();
include_once "config.php";
$current_user = $_SESSION["unique_id"];
if (isset($_POST["query"])) {
$query = mysqli_real_escape_string($conn, $_POST["query"]);
$sql = "SELECT * FROM users WHERE NOT unique_id = {$current_user} AND (first_name LIKE '%{$query}%' OR last_name LIKE '%{$query}%') ";
$output = "";
$query = mysqli_query($conn, $sql);
if (mysqli_num_rows($query) > 0) {
include_once "list.php";
} else {
$output .= "User not found :(";
}
echo $output;
}
?>