summaryrefslogtreecommitdiff
path: root/user.php
blob: a5e1d168e073ec50744a4d88df7662c6780f9292 (plain)
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
include_once 'includes/db_inc.php';

session_start();

$user_name = "Unknown";
$user_date = 0;

if (!isset($_GET['name'])) {
} else {
	$sql = "SELECT user_date FROM users WHERE user_name = '" . $_GET['name'] . "'";
	$result = mysqli_query($dbc, $sql);

	if (!$result) {
		die('Error trying to display user page: ' . mysqli_error($dbc));
	}

	if (mysqli_num_rows($result) == 0) {
		$user_name = "Unknown";
	} else {
		while ($row = mysqli_fetch_assoc($result)) {
			$user_name = $_GET['name'];
			$user_date = $row['user_date'];
		}
	}
}
?>
<!DOCTYPE html>
<html>
<head>
	<title><?php echo $user_name; ?>'s Profile - cflip.net forum</title>
</head>
<body style="width: 720px;margin: auto;">
	<?php include_once "templates/header.php" ?>
	<h1><?php echo $user_name; ?></h1>
	member since <?php echo $user_date; ?>
</body>
</html>