Horje

Now, Create Login redirect Page

Copy and Paste Following code to welcome.php After login, It will appear Login Session Page. Put following code in any php file where you want to show Login Session. <?php session_start(); ?>
welcome.php
Example: PHP
<?php session_start(); /* Starts the session */

if(!isset($_SESSION['UserData']['Username'])){
        header("location:login.php");
        exit;
}
?>

Congratulation! You have logged into password protected page. <a href="logout.php">Click here</a> to Logout.




Type:
php
Category:
Web Tutorial
Sub Category:
PHP Login Tutorial
Uploaded by:
Admin