|
Posted by pengypenguin on 11/19/97 11:56
Hello all,
I am trying to create a user authentication system, and I would like to
separate the authentication code into include files. As I see it, the
basic flow would go something like this:
if (not authentic) {
display login
} else {
display content
}
I would like to separate this code so that the login bit is in an
included file. I imagined the breakup like this:
file: [auth_head.php]
-----------------------
if (not authentic) {
display login
} else {
-----------------------
file: [auth_foot.php]
-----------------------
}
-----------------------
So in each file which requires authentication, I can simply include the
first bit in the head, the second bit at the bottom, and put the
content in the middle. Makes sense, right?
Unfortunately, it seems that you cannot continue a { bracket }
statement across includes in this manner, as php errors. (It wants you
to wrap up your brackets before the end of the file.)
Does anyone know of a solution to this problem, or perhaps a
work-around?
Thanks very much, in advance.
-- Whit Nelson
Navigation:
[Reply to this message]
|