Tag Archives: PHP

Password protection – htaccess

Create .htaccess file and paste the below given code into it .

AuthName “Member’s Area Name”
AuthUserFile /path/to/password/file/.htpasswd // Dont for got give a valid path of .htpasswd file
AuthType Basic
require valid-user

Create .htpasswd and gienterve the user name and encrypted password separated with ‘:’. The text would look like as follows

username:encryptedpassword
phpcodez:60h5w63DqQfls

NOTE : You can create the password using the link “http://www.4webhelp.net/us/password.php”

Hide PHP file extension

You can hide the php file extension using .htaccess so that you can confuse the spammers and hackers .

You can use “asp” file to work as a “php” file ie use the extension “asp” for yourr file instead of “php”.

You jsut need to cerate a .htaccess file and ad the code shown below

# Make PHP code look like asp or perl code
AddType application/x-httpd-php .asp

After this create file “comment.asp” and with php codes in it.

Then load the page “comment.asp”