PHP forums, MySQL forums, Web Development resources

Home PageHome    PHP ResourcesTopic List    FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups 
 RegisterRegister
    ProfileProfile    Log in to check your private messagesLog in to check your private messages    Download the RSS Reader RSS Feed Download the RSS Reader RSS for this forum Log inLog in 

PHP Forum :: MySQL Forum :: Java Script Forum



Dynamically generating .htaccess

 
Post new topic   Reply to topic    WeberForums.com Forum Index -> PHP General
View previous topic :: View next topic  
Author Message
Seth Northrop
Guest





PostPosted: Fri Feb 05, 1999 10:26 pm    Post subject: Dynamically generating .htaccess Reply with quote

howdy.

I manage a site which authenticates users by IP address. However, the flat text file is beginning to slow down Apache (having to parse the file each time you need to authenticate).

I was curious on whether the .htaccess file could dynamically generate an allow from statement using PHP and mysql. I have mod_auth_mysql installed, but, it only supports user/password authentication. I would like to have the htaccess parse the database based on the users' host address, if it returns a match then generate an allow from statement for that address in the .htaccess file, if it fails send a 403.

Just curious

Seth
Back to top
Boaz Yahav
Guest





PostPosted: Sat Feb 06, 1999 8:09 pm    Post subject: RE: Dynamically generating .htaccess Reply with quote

First let me say that IP as an authentication method is really bad. Practically anyone can pretend to come from any IP he wishes.

I really dont see your problem. At the begining of each page or just at the main page you should run a simple function that checks the person's IP against the DB.

Whats not clear is who manages the DB? why can't he just manage the .htaccess file?.

I guess you can chcnge the .htaccess file on the fly but than you have a security issue cause "nobody" has write access to your .htaccess file.

I'm not familiar with your system but i'm sure it can be set up to work diffrently in all that concerns authentication.

hope that helped some... Smile

berber
Back to top
Boaz Yahav
Guest





PostPosted: Sat Feb 06, 1999 8:10 pm    Post subject: RE: Dynamically generating .htaccess Reply with quote

One more point, if "nobody" allready has access to the .htaccess file (to change it) he has access to the rest of the directory as well so what does that help?

berber
Back to top
Seth Northrop
Guest





PostPosted: Mon Feb 08, 1999 9:03 am    Post subject: RE: Dynamically generating .htaccess Reply with quote

First let me say that IP as an authentication method is really bad. Practically anyone can pretend to come from any IP he wishes.

----------->

Yes.. agreed, however, we are providing site licenses to elementary schools, and, management of login/password combinations with that client base would be a nightmare =)

------------>

I really dont see your problem. At the begining of each page or just at the main page you should run a simple function that checks the person's IP against the DB.

------------->

Thanks. amazing how the easy solution evades you sometimes. =)
Back to top
Display posts from previous:   
WeberTrivia Questions WeberTrivia Questions
 Think you are smart? Prove it!. Try your skills with these questions :
 WeberTrivia QuestionsRecursive arrays and multi-dimensional arrays are one and the same. (PHP and MySQL)
 WeberTrivia QuestionsThe \"cache_dir\" tag of the squid configuration has a default of /var/spool/squid. (Linux)

WeberTrivia Questions



PHP Code Examples
 Stream diffrent sizes of images from a single image to save disk space.
 JavaScript dropdown list menu to switch any page.
 Dump the contents of a PHP variable in html format with a recursive list of subfolders and files from a given root directory.
 PHP Dump in html format the contents of one array variable with a recursive list of the nested array variables inside.
 Link Extractor - This function is used to extract links from a given URL. This will convert relative path into absolute path and also remove PHPSESSID stuff.
 Building a Dynamic Form using Javascript and innerHTML. Add form elements in realtime without refreshing the page.
 A PHP Calendar function with CSS : add a cool calendar to any php page by just adding a calendar class based function.
Post new topic   Reply to topic    WeberForums.com Forum Index -> PHP General All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum






Powered by phpBB © 2001, 2005 phpBB Group
PHP Forum :: MySQL Forum :: Java Script Forum