-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch_full_result.php
50 lines (40 loc) · 1.15 KB
/
search_full_result.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
session_start();
if(!isset($_GET['id']) || empty($_GET['id'])) {
header('Location: search.php');
}
// Check if the user is logged into the system
include "validate.php";
include "src/head.php";
include "src/header.php";
// include "src/mainmenu.php";
include 'db.php';
echo "<fieldset><legend>User Information</legend>";
$id = $_GET['id'];
$sql = "select * from users where id = $id;";
$result = mysql_query($sql, $link);
if ($result == false) {
echo "<p>Error: cannot execute query</p>";
}
else {
$num_rows = mysql_num_rows($result);
if ($num_rows >= 1) {
while($row = mysql_fetch_array($result)) {
echo "<p>";
echo "<b>Name:</b> " . $row["name"] . "<br />";
echo "<b>Date of birth:</b> " . $row["date_of_birth"] . "<br />";
echo "<b>Date of registration:</b> " . $row["date_of_reg"] . "<br />";
echo "<b>Email:</b> " . $row["email"] . "<br />";
echo "<b>Information:</b> " . $row["info"];
echo "</p>";
}
}
else {
echo "<p>No user</p>";
}
}
mysql_close($link);
echo "</fieldset>";
include "src/footer.php";
include "src/bottom.php";
?>