Re: include question



"Jon" <jonra@xxxxxxxxxx> wrote in message
news:drldh5$c2d$1@xxxxxxxxxxxxxxxxxx
> All,
>
> I have a question regarding include files. I'm currently wanting to secure
> all of the pages within a directory by having a login script that queries
> a MySQL DB, and writes a session variable confirming the user is
> successfully logged in.
>
> Now, I've done this many times before, however I'm getting kind of sick of
> putting the include file to check the session variable on EVERY page
> within a directory. This is especially irritating if I for whatever reason
> want to unsecure a directory, or change the structure of the login
> system - it forces me to go into each file of the admin area and remove
> the call to the file.
>
> My question is: Is there a way to have PHP force an include file per
> directory instead of just file? Maybe have a global file inside the
> directory that will cascade the include to every page below? Or am I
> simply forced to manually include the file on each page?
>
> Thank you in advance.
>
> Jon
>

Have you tried using the httpd.conf to set the auto_prepend_file directive
for specific directories? You can put it in the <directory> section, so you
can set different directories to prepend your login script. That would take
it out of your code and put it in apache...

http://uk2.php.net/manual/en/configuration.changes.php

dave


.



Relevant Pages

  • include question
    ... I'm currently wanting to secure ... all of the pages within a directory by having a login script that queries a ... Is there a way to have PHP force an include file per ...
    (comp.lang.php)
  • Re: Mapping Drives in Tserver Session
    ... Login script? ... Buster Davis wrote: ... we have a 2003 TS setup and I was wanting to know how I would go ...
    (microsoft.public.windows.terminal_services)
  • unattended profile setup?
    ... We're wanting to set up a user's Outlook profile using an ... exchange account. ... Possibly using a login script and a run- ...
    (microsoft.public.outlook.installation)
  • Re: unattended profile setup?
    ... > We're wanting to set up a user's Outlook profile using an ... > exchange account. ... Possibly using a login script and a run- ...
    (microsoft.public.outlook.installation)
  • RE: Login script
    ... L: Drive - how about adding the follwoing lines to your login script: ... (a simple way of achieving what you're wanting) ...
    (microsoft.public.windows.server.general)