-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhandler.php
More file actions
33 lines (30 loc) · 1.24 KB
/
handler.php
File metadata and controls
33 lines (30 loc) · 1.24 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
<?php
$server = "cse.unl.edu";
$username = "stackoverflow";
$password = "BU}uE@";
$database = "stackoverflow";
if(isset($_POST['search_input']))
{
$mysqli = new mysqli($server,$username,$password,$database);
$input = $_POST['search_input'];
$query = "select * from se_users where display_name like '%$input%' order by creation_date;";
if($result = $mysqli->query($query))
{
echo "<form name='user_select' action='jsonEncode.php' method='post'>";
while($row = $result->fetch_assoc())
{
echo "<img class='avatar' src='http://www.gravatar.com/avatar/" . $row['email_hash'] . "'>" . $row['display_name'] . ' ' . $row['creation_date'] . ' ' . $row['reputation'] . ' ' . '<input type="radio" name="userID" value="' . $row['id'] . '">' . '<p>';
}
if($result->num_rows > 0)
{
echo "<input type='submit' value='JSON-ify (this could take several minutes)'></form>";
}
else
{
echo 'No users match your query :/';
echo '<p><a href="vr.php">Return</a>';
}
}
$mysqli->close();
}
?>