44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
<?php
|
|
session_start();
|
|
%PLEAZE_NO_CACHE%
|
|
%SET_LOGIN_VARIABLE%
|
|
%NO_CHEAP_SESSION_STEALING%
|
|
%REQUIRE_LOGIN%
|
|
|
|
$pdo = new PDO('mysql:host=%DB_SERVER%;dbname=%DB_NAME%', '%DB_USERNAME%', '%DB_PASSWORD%');
|
|
$error = false;
|
|
$error_message = "";
|
|
if (!$error) {
|
|
$statement = $pdo->prepare("SELECT name FROM users WHERE id=:uid"); // to be replaced with optional user name off the user data table
|
|
$statement->execute(array("uid"=>$_SESSION[user_id]));
|
|
$dbentry = $statement->fetch();
|
|
$username = $dbentry[name];
|
|
}
|
|
if (!$result) {
|
|
$error_message = "Error: SQL error.\n" . $statement->queryString . "\n" . $statement->errorInfo()[2];
|
|
}
|
|
|
|
$navbar = "home";
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>ThreadR</title>
|
|
%STYLESHEET%
|
|
<link rel="icon" type="image/png" href="%CONTENT_DIR%/img/favicon-32x32.png" sizes="32x32" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
</head>
|
|
<body>
|
|
%NAVBAR%
|
|
<div class="container">
|
|
<div class="item-1">
|
|
<center><h1>ThreadR</h1></center>
|
|
</div>
|
|
<div class="item-2">
|
|
<center><h3><?php echo "Welcome back, "; echo "$username"; echo "!";?> </h3></center>
|
|
</div>
|
|
</div>
|
|
%BANNER_COOKIES%
|
|
</body>
|
|
</html>
|