1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

User authentication help

Discussion in 'PHP' started by agent186, Jan 21, 2005.

  1. #1
    I am new to PHP coding. I have a script that performs user authentication based on an LDAP. My proplem is I don't know how to invoke the script to run on the protected site. Right now we are using .htaccess files. So, the home page and supsequent pages are all protected by one log in. I want this to be true for my script. Right now it seems the script will only protect one page. Where do I place the php script and what do I need to do to make sure it is run whenever a user goes to any page within the site. For example, I want the script to prompt for a username and password when someone goes to www.example.com as well as when they go to www.example.com/pagetwo.html. But if they have already logged on once, I don't want them prompted again everytime they they link to another page on the same domain. Please be as specific as possible, as I am new to this. An answer such as place your script in the [place directory here] directory, and add this line of code ([line of code]) to your [page or pages] page, would be most appreciated. Thank you in advance for your help.
     
    agent186, Jan 21, 2005 IP
  2. Eadz

    Eadz Peon

    Messages:
    108
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can try using php's auto_prepend function to automatically prepend the auth file to all pages under the directory.
    E.g. in your .htaccess :
    php_value auto_prepend_file /path/prepend.php
    Code (markup):
    More info : http ://www.zend.com/zend/spotlight/prepend.php
     
    Eadz, Jan 25, 2005 IP
  3. gullam18

    gullam18 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hi,
    i m also having the same problem. i think i ll get it from the above answer. Thanks.

    ------------------
    gullam18
    powering web hosting company in india
     
    gullam18, Feb 6, 2005 IP