Created
September 30, 2015 02:48
-
-
Save AriffAzmi/6b7cc2bdbd49282ddf2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once 'dbconfig.php'; | |
if (!isset($_SESSION['id'])) { | |
echo '<script>'. 'alert("Please login");'. '</script>'; | |
echo '<script>'. 'window.location.href="login.php";'. '</script>'; | |
} | |
$user_id = $_SESSION['id']; | |
$stmt = $conn->prepare("SELECT * FROM users WHERE id=:user_id"); | |
$stmt->bindParam(':user_id', $user_id); | |
$userRow=$stmt->fetch(PDO::FETCH_ASSOC); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment