Jump to content

need to make it so if a users is not logged in it displays a different message?


runnerjp

Recommended Posts

I use sessions upon logging into my website. Then on my welcome page you can use an if statement to detect if there is a session for that user. If the user is logged in my pages display Welcome ".$_SESSION['username']."  If they are not logged in it can display either please log in or in your case you could have it say "Welcome Guest!

You actually need to leave that in and then fix where it's originally set. What you're doing now is a poor coding practice. Read this:

http://us3.php.net/manual/en/language.types.array.php

 

Scroll down to :

Array do's and don'ts

Why is $foo[bar] wrong?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.