-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearchprofiles.php
38 lines (29 loc) · 921 Bytes
/
searchprofiles.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
<?php
require "header.php";
include_once 'includes/dbh.inc.php';
?>
<title> <?php echo $username ?>s Profile </title>
<main>
<?php
//Check if the form has been submitted
if (isset($_GET['username'])){
$username = $_GET['username'];
$userquery = mysqli_query($conn, "SELECT * FROM users WHERE uidUsers='$username'")
or die ("The query could not be completed. Please try again later.");
if (mysqli_num_rows($userquery)!= 1){
die ("That username could not be found.");
}
while ($row = mysqli_fetch_array($userquery, MYSQLI_ASSOC)) {
$email = $row['emailUsers'];
$dBusername = $row['idUsers'];
}
?>
<h2><?php echo $username; ?>'s Profile</h2><br>
<table>
<tr><td>Username: </td><td><?php echo $username; ?></td></tr>
<tr><td>E-mail: </td><td><?php echo $email; ?></td></tr>
</table>
<?php
} else die ("You need to specify a username.");
?>
</main>