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

36 lines
1.2 KiB
PHP
Raw Normal View History

2020-02-21 06:54:51 +01:00
<?php
session_start();
//Todo: make this a setting for users that use VPNs/Proxies and seem to jump around the world rather quickly...
2020-02-21 13:14:22 +01:00
%ENFORCE_IP%
2020-02-21 06:54:51 +01:00
$pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!');
$statement = $pdo->prepare('SELECT name FROM users WHERE id = :user_id;'); // to be replaced with optional user name off the user data table
$result = $statement->execute(array('user_id' => $_SESSION['user_id']));
$dbentry = $statement->fetch();
$username = $dbentry['name'];
?>
<!DOCTYPE html>
<html>
<head>
<title>ThreadR</title>
<link rel="stylesheet" type="text/css" href="%CONTENT_DIR%/style.css">
</head>
<body>
<ul class="topnav">
<li><a class="active" href="%CONTENT_DIR%/userhome/">Home</a></li>
2020-02-19 22:57:54 +01:00
<li><a href="%CONTENT_DIR%/news/">News</a></li>
<li><a href="%CONTENT_DIR%/boards/">Boards</a></li>
<li><a href="%CONTENT_DIR%/about/">About</a></li>
<li class="right"><a href="%CONTENT_DIR%/logout/">Log Out</a></li>
</ul>
<br />
<div class="container">
<div class="item-1">
<center><h1>ThreadR</h1></center>
</div>
<div class="item-2">
2020-02-21 06:54:51 +01:00
<center><h3><?php echo "Welcome back, $username !";?> </h3></center>
</div>
</div>
</html>