GO BACK!Ask the Scripting Guru

TDavid started programming using Basic back in the Vic-20 and Commodore 64 days when 5K was a lot of space to work with. He eventually got into machine language and later C/C++ and as the web came along various other programming languages including Perl, JavaScript and most recently PHP. He started tdscripts.com in 1999 to share some of the scripts he was using on his own websites. Word has spread rapidly as it often does on the web and now tdscripts.com has 19 original scripts. All scripting is still done today by TDavid, although he has added one employee to assist with keeping the books and answer some basic customer service questions. He prides himself on being one of the few remaining programmers on the net that is actually accessible to the public via telephone.

He added http://www.php-scripts.com/ to support the popular PHP scripting language and to track his diary of learning this language online in the Winter of 1999. After an overwhelming response from webmasters and programmers for more tutorials and how-to lessons, he decided to open http://www.scriptschool.com/ in Spring 2000 which would focus primarily on teaching webmasters how to program in various languages for the web. It includes a LIVE radio broadcast at http://www.scriptschool.com/radio/ every Friday from 2-4pm PST, Q & A forums and a full blown 16 week course on how to program using PHP.

TDavid is also a regular columnist for KliXXX magazine and has written dozens of articles for ezines all over the web and participated in or completed custom programming projects spanning the globe.

Scripting Article

.htaccess and .htpasswd to make encrypted passwords without Telnet access

You can use your FTP program to make a directory.

You can create an .htaccess and .htpasswd file using Microsoft Notepad or Wordpad. Here is an example of what to cut and paste into the .htaccess file (don't include the #--->):

#---------begin--------------->

AuthUserFile /web/sites/yournetpondaccountname/yourwebsite/yourdirectorytoprotect/.htpasswd
AuthName "Title of my protected directory"
AuthType Basic
<Limit GET>
order deny,allow
require valid-user
</Limit>

#-----------end------------------>

Now save this file as TEXT only naming it ".htaccess" -- (by the way, notepad or wordpad might rename it .htaccess.txt which will make it not work, so make sure to rename this if it does add the .txt extension)

Now you need to create your .htpassword file which includes an encrypted password. I have a freeware backdoor program which you can use from your browser for single word password encryption so that you don't have to use Telnet. You can access it by typing into your browser (replace PASSWORD with the password you want to use):

http://www.tdscripts.com/cgi-bin/bouncer.cgi?react=crypt&password=PASSWORD

Now in the empty notepad file type the login id you want to use. For example I want to use franklin and then use the : symbol and then cut and paste the encrypted password after the : (for example, franklin with the encrypted PASSWORD -- would look like this:)

franklin:sai3gAJK84MO2

Now save the above file with your login:encryptepassword as .htpasswd in TEXT mode and FTP in ASCII to the directory you want to protect along with the .htaccess file you created. Now try to login from your browser to your directory and you will see that until you use the proper login and pw) you will be denied access.



    Scripting Guru's Favorite links

    • php knowledge base, searchable and very useful - http://www.e-gineer.com/phpkb/
    • great messageboards, although they run a bit slow with all the posting activity - DevShed
    • Some of the best animated funny cartoons on the web, for that much needed break - Camp Chaos
    • all things that are mySQL start here - mySQL.com
    • no flashy graphics here, perfect for those coding in Perl - http://www.cpan.org/
    • great drag and drop support FTP editor (and free!) - smartFTP

[BACK] [TOP]


image
image image

All Rights Reserved
Privatelabelresources.com © 1999, 2000 & 2001

WEBSITE DESIGNED BY: GRAPHICS MASTER XXX