View Full Version : Count views/downloads
Does anyone know where I can find a PHP script so that a user can't download over a certian amount of files a month? Thanks.
Also, could I make a script that writes to the .htpasswd file, and puts in the username and password, after encription?
Originally posted by Tidane
. . . could I make a script that writes to the .htpasswd file, and puts in the username and password, after encription?
Try this to get you going:
$encrypted = crypt($pass);
$ht_pass = "username:$encrypted\n";
$filename = "/www/u/user/.htpasswd";
$handle = fopen($filename,"w");
fwrite($handle,"$ht_pass");
fclose($handle);
Obviously you must change the path to your htpasswd, your username, and put the password in $pass.
Thanks, that'll help...now to figure out where I could put it...or how it make it work. lol
I use a variation of that to generate a random value, change the htpassword and email me the new password. I kick it off with cron every night so I have a new random password evey day.
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.