Re: PHP + apache .htaccess

From: Date: Thu, 15 Nov 2001 07:18:26 +0000
Subject: Re: PHP + apache .htaccess
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-74674@lists.php.net to get a copy of this message
Thanks very much ! I think I've got the way ! ^_^ "Johan Holst Nielsen" <johan@1way2print.net> wrote in message news:20011115065747.94040.qmail@pb1.pair.com... > > then, can .htaccess store the user expried date ? > > like Peter is not allowed to login after 2Feb 2001, Sam is expired after > > 11Nov 2002...... > > Yes and no. You just have to make a change in the .htaccess file. > > > and also, is it possible to maintain the .htaccess automatically ? > > like I write a shell script and run it schedully to delete those expired > > entry ? > > Yes it a possibility. Think you can make it with a simply fopen() fwrite(), > with the cron daemon. > > The other possibility is to make a folder outside webscope. > Then you can make a loginscript in mysql like: > > <?php > $connection = mysql_connect("host", "user", "pwd"); > mysql_select_db("db"); > $query = "SELECT id FROM users WHERE user = '$user' AND pwd = > '$pwd'": > $result = mysql_query($query); > if(mysql_num_rows($result) > 0) { > header("Content-type: you choose"); > header("Content-length: filesize('/home/filename')"); > header("Content-Disposotion: inline; filename=filename.tar.gz"); > readfile("/home/filename"); > } > else { > echo "you are not allowed to download this file!": > } > ?> > Regards, > Johan

« previous php.general (#74674) next »