-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththird.php
More file actions
35 lines (32 loc) · 1.34 KB
/
Copy paththird.php
File metadata and controls
35 lines (32 loc) · 1.34 KB
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
<html><title>Search Results</title><head>
<a href="index.php">
<img alt="OneCall" src="OneCall logo.png" align="left" ></a><br>
<h1 style=" margin-right: 193px;">Search Results</h1>
</head>
<body bgcolor="blue" text="white" style="text-align: center;background-image: url(bg.jpg);
background-repeat: repeat-x;"">
<div style=" float: left;
margin-left: 291px;
">
<?php
include "db_connect.php";
$fn = $_GET["email"];
$sql = "SELECT first_name, last_name, email, home_add, home_phone, cell_phone FROM user where email LIKE '%". $fn . "%'";
$result = mysqli_query($conn, $sql);
/* if (mysqli_num_rows($result) > 0) {
// output data of each row
while($row = mysqli_fetch_assoc($result)) {
echo "First Name: " . $row["first_name"]. " Last Name: " . $row["last_name"]. "Email " . $row["email"]. "<br>";
}
} else {
echo "0 results";
} */
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<br> First Name: " . $row["first_name"]. "<br>". " Last Name: " . $row["last_name"]."<br>". " Email: " . $row["email"] ."<br>". "Home Address: " . $row["home_add"] ."<br>". "Home Phone: " . $row["home_phone"] . "<br>" . "Cell Phone: " . $row["cell_phone"] . "<br>";
}
} else {
echo "0 results";
}
echo "<br> <a href='users.php' style='color: white'>Click here</a> to go to Users page";