Site hosted by Angelfire.com: Build your free website today!
#!/usr/local/bin/perl ################################################################################## # Password Protector Script # Copyright 1996 Techno Trade http://www.technotrade.com # Written By : Sammy Afifi sammy@technotrade.com # Date Last Modified : Oct 22, 1996 ################################################################################## # # This script is free of charge for non-commercial sites. # Please refer to our web site for registering this script for commercial use. # ################################################################################## # Change these variables with your own values $correctpass = "helphelphelp"; $correcturl = "http://gothik.proboards.com"; $scriptlocation = "http://technotrade.com/password/password.cgi"; # Read in form data &parse_form; $password = $input{'password'}; $function = $input{'function'}; if ($function eq "post") { if ($password eq $correctpass) { &goto_url; } &badpassword; } &ask_password; sub badpassword { print "Content-type: text/html\n\n"; print "\n"; print "Invalid Password\n"; print "\n"; print "

Invalid Password


\n"; print "\n"; print "\n"; exit; } sub ask_password { print "Content-type: text/html\n\n"; print "\n"; print "Editor\n"; print "\n"; print "
Please Enter Your Password\n"; print "



\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "
\n"; print "
\n"; print "Password Script - brought to you by The Techno Trade CGI Archive\n"; print "
\n"; exit; } sub goto_url { print "Location: $correcturl\n\n"; } sub parse_form { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); if (length($buffer) < 5) { $buffer = $ENV{QUERY_STRING}; } @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $input{$name} = $value; } }