-
Notifications
You must be signed in to change notification settings - Fork 0
/
formSearch.php
32 lines (29 loc) · 846 Bytes
/
formSearch.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
<!-- form handler for search -->
<!DOCTYPE html>
<html lang="en">
<head>
<link href="fotoapp.css" rel="stylesheet">
<?php
require('db.php');
?>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search form handler</title>
</head>
<body>
<?php
session_start();
$search = $_POST['search'];
$sql = "SELECT * FROM `user` WHERE `Username` like '%".$search."%'";
$result = $conn->query($sql);
while($row = $result->fetch())
{
echo "<a href='otherspage.php?name=".$row['Username']."'>".$row['Username']."</a>";
echo "<img src='".$row['Profile']."'";
echo "<br>";
echo "<br>";
}
?>
</body>
</html>