print email address of user(?)
This commit is contained in:
parent
173c258b00
commit
4b8d3dc9ea
12
secure.php
12
secure.php
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
$pdo = new PDO('mysql:host=localhost;dbname=usertable', 'usertable', 'password');
|
||||
if(!isset($_SESSION['userid'])) {
|
||||
die('Please <a href="login.php">login</a>');
|
||||
}
|
||||
@ -8,5 +9,16 @@ $userid = $_SESSION['userid'];
|
||||
|
||||
echo "Hi ".$userid;
|
||||
echo "<br/>";
|
||||
echo "<br/>";
|
||||
echo "<br/>";
|
||||
$statement = $pdo->prepare("SELECT * FROM users WHERE id = $userid");
|
||||
$result = $statement->execute(array('email' => $email));
|
||||
$user = $statement->fetch();
|
||||
|
||||
echo $email;
|
||||
echo "<br/>";
|
||||
echo "<br/>";
|
||||
echo "<br/>";
|
||||
|
||||
echo "This is secure now!";
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user