-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathread.php
81 lines (73 loc) · 2.28 KB
/
read.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
require 'database.php';
$id = null;
if ( !empty($_GET['id'])) {
$id = $_REQUEST['id'];
}
if ( null==$id ) {
header("Location: index.php");
} else {
$pdo = Database::connect();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "SELECT * FROM contact where id = ?";
$q = $pdo->prepare($sql);
$q->execute(array($id));
$data = $q->fetch(PDO::FETCH_ASSOC);
Database::disconnect();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="span10 offset1">
<div class="row">
<h3>Contact Details</h3>
</div>
<div class="form-horizontal" >
<div class="control-group">
<label class="control-label">First Name:</label>
<div class="controls">
<label class="checkbox">
<?php echo $data['first'];?>
</label>
</div>
</div>
<div class="form-horizontal" >
<div class="control-group">
<label class="control-label">Last Name:</label>
<div class="controls">
<label class="checkbox">
<?php echo $data['last'];?>
</label>
</div>
</div>
<div class="control-group">
<label class="control-label">Email Address:</label>
<div class="controls">
<label class="checkbox">
<?php echo $data['email'];?>
</label>
</div>
</div>
<div class="control-group">
<label class="control-label">Mobile Number:</label>
<div class="controls">
<label class="checkbox">
<?php echo $data['mobile'];?>
</label>
</div>
</div>
<div class="form-actions">
<a class="btn" href="index.php">Back</a>
</div>
</div>
</div>
</div> <!-- /container -->
</body>
</html>