-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbb_det.php
More file actions
58 lines (49 loc) · 1.45 KB
/
bb_det.php
File metadata and controls
58 lines (49 loc) · 1.45 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html lang="en-US">
<?php
require("conn.php");
session_start();
?>
<head>
<meta charset="UTF-8">
<title>Blood Inventory-login or sign up </title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="css/page_style.css">
</head>
<body>
<div class="title">
<header>
<h1 >Blood Inventory System</h1>
</header>
</div>
<div class="navbar">
<a href="BB_main.php">Home</a>
<a href="#news">History</a>
<a href="bb_det.php">Details</a>
<a href="logout.php" style="float: right">Logout</a>
</div>
<div class="main">
<?php
$stmt = $conn->prepare("SELECT * from blood.bloodbank where email = :email and password = :pass");
$stmt-> bindParam(':email',$_SESSION["email"]);
$stmt->bindParam(':pass',$_SESSION["pass"]);
$stmt->execute();
$result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
$iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($stmt->fetchAll()),RecursiveIteratorIterator::LEAVES_ONLY);
foreach($iterator as $k=>$v) {
if($k!="password")
{
echo "<p>".test_input(str_replace("_"," ",ucfirst($k))).": ".test_input($v)."</p>";
}
}
?>
</div>
</body>
<?php
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>