-
Notifications
You must be signed in to change notification settings - Fork 2
/
search.php
149 lines (144 loc) · 6.8 KB
/
search.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!--
* File : search.php (Search)
* Developer : Mouhcine MESMOUKI + Omar ABDELMOUJIB
-->
<!DOCTYPE html>
<head>
<title>User Search</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection" />
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection" />
<script language="javascript" type="text/javascript">
function validateForm() {
var email = document.forms["Form"]["email"].value;
if (email == "") {
alert("Email Required");
return false;
}
}
</script>
</head>
<body>
<nav class="white" role="navigation">
<div class="nav-wrapper container">
<a id="logo-container" href="index.php" class="brand-logo">Web App</a>
<ul class="right hide-on-med-and-down">
<li><a href="index.php">Home</a></li>
<li><a href="signup.php">Sign Up</a></li>
<li><a href="login.php">Login</a></li>
<li><a href="search.php">Search</a></li>
</ul>
<ul id="nav-mobile" class="side-nav">
<li><a href="index.php">Home</a></li>
<li><a href="signup.php">Sign Up</a></li>
<li><a href="login.php">Login</a></li>
<li><a href="search.php">Search</a></li>
</ul>
<a href="#" data-activates="nav-mobile" class="button-collapse"><i class="material-icons">menu</i></a>
</div>
</nav>
<div class="container">
<div class="section">
<div class="row">
<div class="col s12 center">
<h3><i class="mdi-content-send brown-text"></i></h3>
<h4>User Search</h4>
</div>
</div>
</div>
</div>
<div class="container">
<div class="section">
<div class="row">
<div class="row">
<form class="col s12" name="Form" action="" onsubmit="return validateForm()" method="POST">
<div class="row">
<div class="input-field col s6">
<i class="material-icons prefix">email</i>
<input name="email" type="email">
<label for="email">Email</label>
</div>
<button class="btn waves-effect waves-light" type="submit" name="action">Submit
<i class="material-icons right">send</i>
</button>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="container">
<div class="section">
<div class="row">
<div class="row">
<form class="col s12">
<div class="row">
<div class="col s12 m8">
<div class="card blue-grey darken-1">
<div class="card-content white-text">
<span class="card-title">User Details</span>
<br>
<?php
$link = mysqli_connect("localhost", "root", "root", "db");
if (!empty($_REQUEST['email'])) {
$email = mysqli_real_escape_string($link, $_REQUEST['email']);
$sql = "SELECT * FROM userdata WHERE email LIKE '%" . $email . "%'";
$r_query = mysqli_query($link, $sql);
while ($row = mysqli_fetch_array($r_query)) {
echo 'First Name: ' . $row['firstname'];
echo '<br /> Last Name: ' . $row['lastname'];
echo '<br /> Age: ' . $row['age'];
echo '<br /> Phone: ' . $row['phone'];
echo '<br /> Gender: ' . $row['gender'];
}
}
mysqli_close($link);
?>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<footer class="page-footer teal">
<div class="container">
<div class="row">
<div class="col l6 s12">
<h5 class="white-text">About</h5>
<p class="grey-text text-lighten-4">This Web App is developped using PHP, MySQL, HTML, CSS, JS and Bootstrap (For Templates) to test our CICD Pipeline, with a potential inclusion of DevSecOps later</p>
</div>
<div class="col l3 s12">
<h5 class="white-text">Tech Specs</h5>
<ul>
<li><a class="white-text">HTML : 5</a></li>
<li><a class="white-text">CSS : 3</a></li>
<li><a class="white-text">Javascript : 1.7</a></li>
<li><a class="white-text">PHP : 7.0.8</a></li>
<li><a class="white-text">MySQL : 5.5.42</a></li>
</ul>
</div>
<div class="col l3 s12">
<h5 class="white-text">At a glance</h5>
<ul>
<li><a class="white-text">Web Page Desgined with php</a></li>
<li><a class="white-text">Dynamic web site</a></li>
<li><a class="white-text">Responsive Design (Template used from quora)</a></li>
<li><a class="white-text">Built on Macintosh and ubuntu (On a virtual Machine {Parralels Desktop})</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
Made by <a class="brown-text text-lighten-3" href="http://github.com/crushoverride007" target="blank">Mouhcine MESMOUKI and Omar ABDELMOUJIB</a>
</div>
</div>
</footer>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="js/materialize.js"></script>
<script src="js/init.js"></script>
</body>
</html>