threadr.lostcave.ddnss.de/threadr/userhome/index.php

46 lines
1.4 KiB
PHP
Raw Normal View History

2020-02-21 06:54:51 +01:00
<?php
2020-03-08 16:20:52 +01:00
session_start();
2020-03-02 14:12:14 +01:00
%PLEAZE_NO_CACHE%
%SET_LOGIN_VARIABLE%
2020-03-08 16:20:52 +01:00
//Todo: make this a setting for users that use VPNs/Proxies and seem to jump around the world rather quickly...
%NO_CHEAP_SESSION_STEALING%
%REQUIRE_LOGIN%
2020-02-21 06:54:51 +01:00
$pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!');
2020-03-08 15:35:56 +01:00
$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";
//ToDo: differentiate between home and userhome (or auto-redirect)
2020-02-21 06:54:51 +01:00
?>
<!DOCTYPE html>
<html>
<head>
<title>ThreadR</title>
2020-03-05 04:56:06 +01:00
%STYLESHEET%
2020-02-23 20:16:54 +01:00
<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>
2020-03-08 15:35:56 +01:00
%NAVBAR%
<div class="container">
<div class="item-1">
<center><h1>ThreadR</h1></center>
</div>
<div class="item-2">
2020-03-08 15:38:01 +01:00
<center><h3><?php echo "Welcome back, "; echo "$username"; echo "!";?> </h3></center>
2020-03-08 15:35:56 +01:00
</div>
</div>
%BANNER_COOKIES%
</body>
2020-03-08 15:35:56 +01:00
</html>