You are here: Re: [HAB] How to build a member area with PHP Sessions « PHP « IT news, forums, messages
Re: [HAB] How to build a member area with PHP Sessions

Posted by Jerry Kita on 02/06/05 20:18

OOzy Pal wrote:
> Dears
>
> Can anyone direct me to a good tutorial on how to build a member area using php sessions?
>
> Thank you
>
> OOzy
>
>
>
> Regards,
> OOzy
>
> What is the purpose of life?
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Search presents - Jib Jab's 'Second Term'

I'm not aware of a tutorial but I do have member areas on my website. I
also will display certain items on a web page depending on whether a
member is actually logged in.

The process is something like this:

1. Members logs into website using USERID and PASSWORD
2. Prior to every new page a session is started
3. If member is in-session then set VALIDLOGON = 'YES'
4. At that point I can display links or images or anything
that are dependent on VALIDLOGON = 'YES'

For example I have PHP code that looks something like:

if (validlogon == 'YES') {
Display stuff that only members see
}

I've also taken it a further step by creating a variable called
'Privileges' which gives gives certain members greater access to
information.

For example I might have PHP code that looks something like:

if (validlogon == 'YES' and privilege = 'C') {
Display stuff for members who have C privilege
}

The last example is the case where I don't want non-members to see a
particular page. I do the check for validlogon at the beginning of the
script .... if the user is not validated then user gets bounced back to
the site HOME page. This PHP code looks like:

if ($validlogon == "NO") {
header("Location: home.php?msg=INVALID USERID OR PASSWORD");
exit; }

Anyways, that's the general idea. It works for me. Others may have more
complex schemes but this serves my purpose well. I'm not a professional
programmer so I generally look for stuff that I can easily understand.

Hope this helps.


--
Jerry Kita

http://www.salkehatchiehuntersville.com

email: jskita@attglobal.net

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация