[thelist] PHP / MySQL User Login System

Andrew Forsberg andrew at thepander.co.nz
Wed Feb 27 21:02:01 CST 2002


>In my current model, I assume that I would need to add the session variable
>checking to each page of content. This is not a good thing. I don't want to
>have to do this if at all possible.

Do you have a generic header included on each page? This would be
really easy if that's the case! If not, then it's only one include,
and one function call at the top of each non-home page file...

>Is it possible to have all the links from my "home page" link back to the
>"home page" with a variable tagged on that defines which content to display
>and then get the home page to display the requested page instead of the home
>page?

If you mean, have the links point to the home page with variables
that activate a script to check the login status, then redirect, then
yes -- but the other pages can still be accessed directly, which
would kinda suck.

If you mean any attempt to access another page will redirect to home
for authentication and another redirect back to the original page,
then no. ;-) You're better off just having an authentication script
included on each page, or in a header file. Otherwise you'll need to
include a script at the top of each non-home page *anyway* which
redirects to home, get the home page to authenticate, then redirect
to the original page. Argh! :)

Cheers
Andrew

--



More information about the thelist mailing list