forked from root/threadr.lostcave.ddnss.de
„threadr/profile/index.php“ ändern
parent
65ac991632
commit
5023fa34fd
|
@ -6,10 +6,18 @@ session_start();
|
||||||
%REQUIRE_LOGIN%
|
%REQUIRE_LOGIN%
|
||||||
|
|
||||||
$pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!');
|
$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
|
$error = false;
|
||||||
$result = $statement->execute(array('user_id' => $_SESSION['user_id']));
|
$error_message = "";
|
||||||
$dbentry = $statement->fetch();
|
if (!$error) {
|
||||||
$username = $dbentry['name'];
|
$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 = "profile";
|
$navbar = "profile";
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue