Home page after successfully login

Login form
After successfully login , member will be redirected to home page. At login stage before the redirection, based on the outcome of checking of login credentials, the session variables are created to maintain the state of the user.

At home page we will check these session variables and accordingly display messages to logged in visitors.
To read the sessions the page must start the session before sending any output to browser
session_start();

Checking of Session

if (isset($_SESSION['userid']&& !empty($_SESSION['userid']))) {
// Welcome message 
}else {
// Ask the user to login
}
Welcome subhendu15

You should see this message if you are successfully logged in.

Your session data is here .

$_SESSION['id']=972m07otal2lv5gkv3o7l26os2
$_SESSION['userid']=subhendu15
$_SESSION['mem_id']=15

To check , you can LOGOUT and visit this page again.

Message to show if user is not logged in.

System will not redirect the user to home page if user is not successfully logged in, however user can use history or can directly type of the address of home page and arrive at the page meant for only logged in users. In such cases we will show a message asking the user to login to continue using the page.
You have not logged in .

Your session data is here .

$_SESSION['id']=
$_SESSION['userid']=
$_SESSION['mem_id']=

You can LOGIN and visit this page again.


plus2net.com



Post your comments , suggestion , error , requirements etc here .







Most Popular JQuery Scripts

1

Two dependant list boxes

2

Calendar with Date Selection

3

Data change by Slider

4

Show & Hide element


JQuery Video Tutorials




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2020 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer