Webmaster/SEO News


Users Viewing This Thread
 1 Guest(s)
amatorbalikci.net

Post Reply  Post Thread 
Parts of website for reg. users?
Author Message
smacker
Member
***


Posts: 234
Group: Registered
Joined: Sep 2007
Status: Offline
Reputation: 0

Country:
Post: #1
Parts of website for reg. users?

My frend is making a web site in php .... it will be page made with "include" function...for header, left and right menus, footer and content...

Content will be in 2 levels....for common guests and for logged / registred users.

He wants that on the top of the site is login form...when user is logged that "hidden" parts of the site be visible....

Cookie or session...no matter...just is important that works with include function...that before that included page is loaded it cheks if user is logged or not.

If its not logged (no session or no cookie) include does not include ..

Sorry for my bad english...

P.S. It can be this way...usualy its included content.php .... if user is logged instead content.php it includes content_reg.php ....

This is Ok too.

09-14-2007 07:29 AM
Find all posts by this user Quote this message in a reply
megna73
Junior Member
**


Posts: 6
Group: Registered
Joined: Feb 2010
Status: Offline
Reputation: 0

Country:
Post: #2
RE: Parts of website for reg. users?

Whether or not you use includes does not matter for what you are trying to do as far as knowing if a user is registered or a guest. What you want to do is have a global variable - let's call it $php_login_status - and your php code will check this var to see if the user accessing your web pages is a guest or not.

$php_login_status states can be:

== 'guest'
== 'registered'

Your php code can then act accordingly - if that means controlling what includes get used, so be it - but basically your trying to control content based on login status has nothing to do with using or not using php includes.

RalphF
http://www.1849webhosting.com
Web Development Services

07-27-2010 02:58 PM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: