Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php session_start();
- //connection to database and other stuff
- if ($user == $dbuser && $pass == $dbpass) {
- $_SESSION['user'] = $user;
- $_SESSION['authenticated'] = "yes";
- $suser = $_SESSION['user']; //just to test if session works
- }
- ?>
- <?php session_start(); ?>
- //small amount of html here
- <?php
- $suser = $_SESSION['user'];
- $sauth = $_SESSION['authenticated'];
- if ($sauth != 'yes') { //not completed yet (needs user name check)
- echo "<a href='./'>Log in</a> first!";
- require ('./login.php');
- die;
- } else {
- //not so important code here
- }
- ?>
- //rest of html here
- <?php session_start();
- ob_start();
- //connection to database and other stuff
- if ($user == $dbuser && $pass == $dbpass) {
- $_SESSION['user'] = $user;
- $_SESSION['authenticated'] = "yes";
- $suser = $_SESSION['user']; //just to test if session works
- }
- ?>
- <?php session_start();
- ob_start();?>
- //small amount of html here
- <?php session_start(); ob_start();
- $suser = $_SESSION['user'];
- $sauth = $_SESSION['authenticated'];
- if ($sauth != 'yes') { //not completed yet (needs user name check)
- echo "<a href='./'>Log in</a> first!";
- require ('./login.php');
- die;
- } else {
- //not so important code here
- }
- ?>
- //rest of html here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement