Create file checklogin.php
############### Code
Create file login_success.php
############### Code
// Check if session is not registered , redirect back to main page.
// Put this code in first line of web page.
session_start();
if(!session_is_registered(myusername)){
header("location:main_login.php");
}
?>
Login Successful
Logout.php
If you want to logout, create this file
// Put this code in first line of web page.
session_start();
session_destroy();
?>
For PHP5 User - checklogin.php
############### Code
?php
ob_start();
$host="localhost";>?
session_start();
session_destroy();
?>?
session_start();
if(!session_is_registered(myusername)){
header("location:main_login.php");
}
?>?php
$host="localhost";>
No comments:
Post a Comment