Skip to main content

Setting up password protection

The best way to secure content on your website is to use .htaccess/.htpasswd protection.   This will password protect any directory and all directories below.   You will need to create a .htaccess file which you put in the directory you want to protect.   You will also need to create a .htpasswd file which you will put out of reach (see tip on Securing Your Package).   The .htaccess file should contain the following:

AuthUserFile /full_unix_path_to_your_file/.htpasswd
AuthName "Any Name You Want"
AuthType Basic
require user username


Where username is the name of the user specified in the .htpasswd file.
You can also make that last line
require valid-user
to accept any user specified in the .htpasswd file.

You can also limit the password protection. For example put the .htaccess code inside these tags
<files file.ext>
htaccess protection code goes here
</files>
to limit the password protection to just the file "file.ext".

The .htpasswd file should genrally be put at your ftp root (above the public directory). It is in the form:

user:encrypted password

The best way to create these files is using notepad (for example create htaccess.txt in notepad), then upload, then rename on the server (.htaccess).

Encrypt your password for .htpasswd
Want your own script that you can use to make the encrypted password lines for your .htpasswd file?  Use this one.

- - Start Script Here - -
<?phpif ($_POST[password] != "" AND $_POST[user] != "" ) {
  
$usr $_POST[user];
  
$pass $_POST[password];
  
$ht_pass crypt($pass);
}
print 
"<html><head><title>Password Encryption</title></head><body>
<form method=post action='crypt.php'>
<font size=5><b>.htpasswd File Password Encryption</b></font>
<br><br>Enter Username<br>
<input name=user value='$usr' size=20>
<br><br>Enter Password<br>
<input name=password value='$pass' size=20>
<br><br><input type=submit name=submit value='Encrypt Now'>
"
;
if (
$_POST[password] != "" AND $_POST[user] != "" ) {
  print 
"<br><br>.htpasswd File Code<br>$usr:$ht_pass";
}
print 
"</form></body></html>";?>

- - End Script Here - -


Comments

Popular posts from this blog

links

0.  https://michael67654.qowap.com/64523001/new-pos-technique-to-perk-up-your-company 1.  https://johnnydinqr.blog2learn.com/52856602/new-pos-system-to-perk-up-your-company 2.  http://edwinsqgcu.onesmablog.com/New-POS-Process-to-Perk-Up-Your-company-43309737 3.  http://chloe69246.bloguetechno.com/New-POS-Process-to-Perk-Up-Your-Business-39814721 4.  http://jacob87541.pointblog.net/New-POS-Technique-to-Perk-Up-Your-online-business-43741223 5.  http://arlette53302.thezenweb.com/New-POS-System-to-Perk-Up-Your-online-business-41464611 6.  http://devinpixna.tinyblogging.com/New-POS-Program-to-Perk-Up-Your-online-business-46354577 7.  https://rylanevsom.blog5.net/46759651/new-pos-program-to-perk-up-your-small-business 8.  https://mariowoesh.affiliatblogger.com/56515206/new-pos-system-to-perk-up-your-organization 9.  https://liam66429.diowebhost.com/60164326/new-pos-procedure-to-perk-up-your-company 10.  https://henry19219.fitnell.com/4557...

Raisonnement, la résolution de problèmes

Les chercheurs ont d'abord développé des algorithmes mimétiques raisonnement humain étapes que les gens utilisent pour résoudre le casse-tête ou faire méthode d'exclusion logique. [2] Dans les années 1980 et 1990 fin, l'étude de la grippe aviaire a développé des méthodes de traitement de l'information incertaine ou incomplète, en utilisant des concepts de probabilité et de l'économie. [3] Pour ces problèmes, les algorithmes requis matériel assez puissant pour effectuer des calculs de géant - à subir « combinaisons d'explosion »: la quantité de mémoire et le temps de calcul peut devenir invisible prendre si la résolution d'un problème difficile. La plus haute priorité est l'algorithme de recherche pour résoudre le problème.  Les gens utilisent généralement les jugements rapides et intuitifs plutôt que pas de déduction que les chercheurs en IA d'origine peuvent simuler. [5] Amnesty International a progressé en utilisant la résolution de problèmes « c...

Tracking and Securing Downloads

If you want to report or track downloads from your website, try this script.   This script will send you an email every time you have a download.   The email will tell you what file was downloaded and who did the download.   You could change this script to keep counts (store them in flat file or MySQL) if you desire. The variable $directory is the directory where the download files are located.   If you want the script in the same directory as the files then use "./" as the directory (you must always have the slash). In your html page, use the following structure as your download link (where name.txt is the file name to download): <a href="download.php?file=name.txt">download</a> Then you use the following script (called download.php): - - Start Script Here - - <?php $emailaddress  =  "email@yourdomain.com" ; $filename  =  $_GET [ 'file' ]; $directory  =  "downloads/" ; $path  =  "$directory$filename" ; putenv (...