driz Posted May 22, 2009 Share Posted May 22, 2009 Hi, is their a nice simple way to password protect an entire directory like say a sub domain as "secure.domain.com" without having to use sessions on every single page and sub directory etc. Basically recreating what htaccess password protect does but with PHP instead. Link to comment Share on other sites More sharing options...
justsomeguy Posted May 22, 2009 Share Posted May 22, 2009 Basically recreating what htaccess password protect does but with PHP instead.That's what sessions do. Link to comment Share on other sites More sharing options...
driz Posted May 22, 2009 Author Share Posted May 22, 2009 What I meant was say I had a sub domain called dev.domain.com and then withing it several directories like dev.domain.com/mysite1/ and dev.domain.com/mysite2/ i dont want to have to add the session code to each page to control whether the person is logged in, rather have the security on the entire sub domain automatically. BUT i want to build an actual interface using PHP so say someone trys accessing one those mini sites they will have to authenticate beforehand. Link to comment Share on other sites More sharing options...
justsomeguy Posted May 22, 2009 Share Posted May 22, 2009 Your options are htaccess or sessions. There might be a way to put code in htaccess to check the PHP session, though I doubt it. I'm not familiar enough with htaccess to know. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.