Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $dsn = 'mysql:dbname=trutime;host=127.0.0.1';
- $user = 'root';
- $password = '';
- //create connection
- //$conn=new PDO($dsn, $user, $password);
- //check connection
- try {
- $conn = new PDO($dsn, $user, $password);
- } catch (PDOException $e) {
- echo 'Connection failed: ' . $e->getMessage();
- }
- //session validation
- $isUserLoggedIn = false;
- if(
- isset($_SESSION['usr']) &&
- isset($_SESSION['pwd']) &&
- !empty($_SESSION['usr']) &&
- !empty($_SESSION['pwd'])) {
- $isUserLoggedIn = true;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement