forked from sharvari-shyam/PiCo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.php
More file actions
44 lines (34 loc) · 967 Bytes
/
search.php
File metadata and controls
44 lines (34 loc) · 967 Bytes
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
<?php
session_start();
include 'dbconn.php';
$key = $_GET['findp'];
echo "key is ".$_GET['findp'];
$key=strtolower($key);
echo " <br>to lower ".$key;
$sql = "SELECT * FROM users;";
$result = mysqli_query($conn, $sql);
$rn=0;
if (mysqli_num_rows($result) > 0) {
// output data of each row
while($row = mysqli_fetch_assoc($result)) {
echo "<br>we in!!";
$name = $row["fname"]." ".$row["lname"];
$name=strtolower($name);
echo "<br> ".$name;
if (strpos($name, $key) !== false ) {
echo "yassssssssssssssss!!!1 <br>";
$_SESSION['res'] = $row["uid"];
header('location:photo.php');
}
else {
$_SESSION['res'] = -1;
// header('location:home.php');
/*if($_SESSION['cur']==1)
header('location:home.php');
else if($_SESSION['cur']==2)
// header('location:photo.php');
*/
}
}
}
?>