[PHP] Re: PHP + apache .htaccess
Thanks very much ! I think I've got the way ! ^_^ "Johan Holst Nielsen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > 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: > > $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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP + apache .htaccess
> 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: 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP + apache .htaccess
then, can .htaccess store the user expried date ? like Peter is not allowed to login after 2Feb 2001, Sam is expired after 11Nov 2002.. 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 ? "Johan Holst Nielsen" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > After I research security issue from the web, I had found apache > > .htaccess which can solve > > my problem. What my problem is that, can .htaccess perform like a database > > system which > > can store users loginID and password, and also set those users have a > > expired time each ?? > > If you want to use .htaccess can you make some links like this, to the > customers who is logged in: > http://username:[EMAIL PROTECTED]/secretfolder/ > > Regards, > Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP + apache .htaccess
> After I research security issue from the web, I had found apache > .htaccess which can solve > my problem. What my problem is that, can .htaccess perform like a database > system which > can store users loginID and password, and also set those users have a > expired time each ?? If you want to use .htaccess can you make some links like this, to the customers who is logged in: http://username:[EMAIL PROTECTED]/secretfolder/ Regards, Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]