UPdated: 6/19/02 Finally found it huh? The script that will do all that cool stuff. =) Questions? Yeap, we all have them.. post here: http://bbs.stormer.org Stormer ----------------------- Files included: readme.txt register.html register.txt email.txt .htaccess .htpasswd register.cgi htpasswd.cgi ------------------------ What does it do? It will confirm the email address is in a valid format before allowing submission. It will confirm that all fields are filled in before allowing submission. It will confirm that the username is not already taken. It will append all submitted information into a flatfile database: register.txt It will append the email addresses into a file: email.txt It will add the username/password to a .htpasswd file. It will send out an email notice to the owner. It will send out an thank you email notice to the registrant. When users try to access protected directory, a username/pass box will appear. ------------------------ Instructions: 1. open .htaccess file up with notepad. At top, put your full unix path to the .htpasswd file. This is the directory to the .htpasswd file. Place this file (.htaccess) in the directory you wish to protect. 2. Place the .htpasswd file in the directory you outlined in the .htaccess file. (chmod this file: 666) 3. Open up htpasswd.cgi (make sure location of perl is correct) close. No need to touch this file again. 4. Open up register.cgi a: location of perl correct? b: define location of following files: $passfile ="/FULL/UNIX/PATH/TO/cgi-bin/downloads/.htpasswd"; #must be read/writable $htpasswd ="/FULL/UNIX/PATH/TO/cgi-bin/downloads/htpasswd.cgi"; $referer ="http://www.YOURDOMAIN.COM/register.html"; $private_area ="/PROTECTED_DIRECTORY_NAME";#example: /protected ( whatever the directory is you wish to password protect ) $reglog ="/FULL/UNIX/PATH/TO/cgi-bin/downloads/register.txt"; #must be read/writable $reglog_email ="/FULL/UNIX/PATH/TO/cgi-bin/downloads/email.txt"; #must be read/writable $sendmail_path = "/usr/bin/sendmail";#change to your path to sendmail $email = "YOUREMAIL\@YOURDOMAIN.COM"; # the "@" symbol must have a "\" before it like so: \@ $subject_to_owner = "SOMEONE REGISTERED"; $subject_to_visitor = "THANK YOU"; 5. Once this is done, you might want to scroll down to this area: # Now with the program ########################################################### # Has to output a Content-type print "Content-type: text/html\n\n "; # Check to see if all required information was entered &no_name unless $contents{'username'}; &no_name unless $contents{'password'}; &no_name unless $contents{'password2'}; &no_name unless $contents{'first_name'}; &no_name unless $contents{'last_name'}; &no_name unless $contents{'address'}; &no_name unless $contents{'city'}; &no_name unless $contents{'state'}; &no_name unless $contents{'postal_code'}; &no_name unless $contents{'email'}; You may not want your users to have to input all this data!! (I didnt anyway) As this file is default all options are required for access. If you dont want a specific area to be "required" simply put a # in front of the line you dont want required. example: # Check to see if all required information was entered &no_name unless $contents{'username'}; &no_name unless $contents{'password'}; #&no_name unless $contents{'password2'}; &no_name unless $contents{'first_name'}; &no_name unless $contents{'last_name'}; #&no_name unless $contents{'address'}; #&no_name unless $contents{'city'}; #&no_name unless $contents{'state'}; #&no_name unless $contents{'postal_code'}; &no_name unless $contents{'email'}; 6. Latter if you want to delete a user, simply goto the .htpasswd file and delete that user. (passwords are encrypted) 7. Remember to chmod 755 register.pl and htpasswd.pl 6. Thats it!! your done! ----------------------------------------------------- Stormer