#!/usr/bin/perl # ###################################################################### # A&M MailForm Version 1.2 # Copyright 1999 Alex Iatskovski 74642.3600@compuserve.com # Created 06/10/99 # Last Modified 06/15/99 # Home URL http://www.anmweb.com # ###################################################################### # # This is a MailForm program that allows you to communicate with the # visitors of your home page without publishing your E-mail address on # the Web. Your real E-mail address is completely hidden from spammers # (it is not shown in web-page source in contrast to most such programs), # but at the same time you are not losing ability to communicate with # a civilized visitors of your Web Site. This program is using Java Script # to display form in a nice popup window. But it works as well if Java Script # is disabled in visitor's browser. It will work with all known Web Browsers. # No more HTML forms programming! This script is generating all necessary # forms dynamically on the fly. # ###################################################################### # # Installation: # # Put this script into your cgi-bin directory and make it executable # (chmod 755 on most system). Then change variables according to your # requirements. # # 1. Make sure the very top line of script is pointed to the exact location # of Perl program on your server. # # 2. Make sure the "$mailprog" variable is pointed to the exact location of # "sendmail" program on your server. # # 3. Make sure to change "$admin_mail" variable to your real E-mal address. # # 4. Make sure the "$cgiurl" variable is pointed to the exact URL of # your script. # # To call this program from the Web pages use something like this: # # ----------Cut here---------- # Contact Us # ----------End of cut---------- # # IMPORTANT! This whole HTML link should be written in ONE LINE! Otherwise # the Java Script will not work. Make sure also that the "/cgi-bin/mailform.cgi" # part is pointed to the real location of the script. If not, you should change # it (two times!) in above example and put it to your HTML page.This construction # will work even with Java Script disabled browsers. # # That's all! Your program is now up and running. # ###################################################################### # # COPYRIGHT NOTICE # (c)Copyright 1999 Alex Iatskovski All Rights Reserved. # # A&M Register program is FREEWARE BUT IT IS NOT PUBLIC DOMAIN! This # program may be used free of charge by anyone so long as this copyright # notice and the comments above remain intact. Any modification to this # program except configuration user variables is strictly prohibited! # By using this code you agree to indemnify A.Iatskovski from any liability # that might arise from its use. # # Selling the code for this program without prior written consent # is expressly forbidden. In other words, please ask first before # you try and make money off of my program. # # Obtain permission before redistributing this software over the # Internet or in any other medium. In all cases copyright and header # must remain intact. # ###################################################################### # Perl's use strict directive checks to make sure variables are # declared before use. It's a handy check to make sure you are doing # what you think you are doing. Always use strict; # Make sure your Perl version is not earlier than this one require 5.003; ###################################################################### # Define Variables # Mail program path my ($mailprog) = '/usr/sbin/sendmail'; # Admin E-mail my ($admin_mail) = 'comunesancalogero@libero.it'; # CGI URL my ($cgiurl) = 'http://www.sancalogero.net/users/comune/sendmail/mailform.cgi'; # Global Vars, don't change! my ($buffer, @pairs, $pair, $name, $value, %FORM); # Done ###################################################################### ################################### ### Do not edit below this line ### ################################### # Antihacker's rooting if ($ENV{'QUERY_STRING'} ne '') { my ($text) = <







  EOF &show_form($title,$text); } ############### sub check_form { ############### if($FORM{'realname'} eq "Your name"){ &error('Ha dimenticato di inserire il suo nome!'); } elsif($FORM{'realname'} eq ""){ &error('Ha dimenticato di inserire il suo nome!'); } elsif(!($FORM{'email'} =~ /([\w-.]+\@[\w-.]+)/)){ &error('Ha dimenticato di inserire la sua E-mail!'); } elsif($FORM{'subject'} eq "Subject"){ &error('Ha dimenticato di inserire un oggetto!'); } elsif($FORM{'subject'} eq ""){ &error('Ha dimenticato di inserire un oggetto!'); } elsif($FORM{'body'} eq "Type your text here"){ &error('Ha dimenticato di scrivere il messaggio!'); } elsif($FORM{'body'} eq ""){ &error('Ha dimenticato di scrivere il messaggio!'); } } ############## sub mail_form { ############## my $text = <IL Suo messaggio è stato inviato, la contatteremo nel minor tempo possibile.

Grazie!

EOF &show_form($title,$text); } ################################### # Sub Error # Usage - &error('Your text here'); ################################### sub error { my $title = 'Error'; my $text1 = $_[0]; my $text = <The program could not complete your request. This was because:

$text1

Click here to start over, otherwise close this window. EOF &show_form($title,$text); } ################################### # Sub main_form # Usage - &show_form($title,$text); ################################### sub show_form { print "Content-type:text/html\n\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "$_[0]\n"; print "\n"; print "\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
\n"; print "\n"; print "\ \;$_[0]\n"; print "\n"; print "
\ \;\ \;\ \;
\ \;$_[1]\ \;
\ \;\ \;\ \;
\n"; print "
\n"; print "
\n"; print "\n"; print "\n"; exit (0); } ##################### ### END OF SCRIPT ### #####################