Forum Moderators: coopster

Message Too Old, No Replies

php alternative to htaccess

         

stadiumtigrium

5:23 pm on Feb 25, 2009 (gmt 0)

10+ Year Member



Hi,

I have a basic site that I've been using ht access to protect a directory of the site. The only file in the main directory is the login page. The problem with the ht access is that there is no good way to make it log out. So I was thinking that there may be a way to do the same thing with a basic php script that would allow me to add a logout button. Does anyone know of a script thats pretty simple to implement because I don't really know much php.

Thanks,
Alex

coopster

12:35 am on Mar 3, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



.htaccess security is basic authentication and your user will remain authenticated until their authorization is altered in some way, typically when they close their browser. Server-side scripting programs such as PHP offer much more control over authentication and access control. Have a look at PHP Session handling [php.net] to get started.