Your Ad Here

Monday, August 24, 2009

Simple login using php (part 3)

Here i am going to discuss about the check.php.
This php page will check if the user is logged in or not . If not it will redirect the user to login page.

<?php

//session starts here
session_start();

//check if session is registered
if(session_is_registered('userid'))

{

//if registered display the content you would like to show
echo 'Hello you are logged in.';

}

else{

//if session variable is not registere send back user to login page
header( "Location: http://login.html" );
}

?>

2 comments until now.

Tom + August 24, 2009 at 11:28 AM (#) :

hey thnks...thats something i was looking for

GST Training + August 9, 2017 at 1:57 AM (#) :

This is the precise weblog for anybody who needs to seek out out about this topic. You notice so much its almost arduous to argue with you. You positively put a brand new spin on a subject that's been written about for years. Nice stuff, simply nice!

Post a Comment