Here is a copy of the script as requested.

#!/usr/bin/perl print "Content-type:text/html\n\n"; # Set Your Options: $mail = 1; # 1 = Yes; 0 = No $remote_mail = 1; # 1 = Yes; 0 = No $allow_html = 0; @referers = ('www.domain.com'); @censor_words=('None','<a','[/url]','laden'); # Check Referring URL &check_url; # If you answered 1 to $mail or $remote_mail you will need to fill out + # these variables below: $mailprog = '/usr/sbin/sendmail'; $recipient = 'mail@myemail.com'; $date_command = "/bin/date"; # Get the Date for Entry $date = `$date_command +"%A, %B %d, %Y at %T (%Z)"`; chop($date); $shortdate = `$date_command +"%D %T %Z"`; chop($shortdate); # Get the input read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); # Un-Webify plus signs and %-encoding $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/<!--(.|\n)*-->//g; $value =~ s{\Q[/url][\E}{[/url] [}g; if ($allow_html != 1) { $value =~ s/<(([^ >]|\n)*)>//g; } $FORM{$name} = $value; &censored_word_check; } # Mail Option if ($FORM{'Email'} eq "") { print "You may have entered this page from an incorrect link"; print "<p><a href=\"http://www.mydomain.com/rentals/cars.htm\">Click H +ere for our MAIN page!</a>"; }else { &censored_word_check; if (($mail eq '1') && ($error != 1)) { open (MAIL, "|$mailprog $recipient") || die "Can't open $mailprog!\ +n"; print MAIL "Reply-to: $FORM{'Email'} ($FORM{'Name'})\n"; print MAIL "From: $FORM{'Email'} ($FORM{'Name'})\n"; print MAIL "To: $FORM{'MailName'}\@myemail.com\n"; print MAIL "Subject: $FORM{'Subject'}\n\n"; print MAIL "Sent by $FORM{'Name'} ($FORM{'Email'}) on $date\n"; print MAIL "------------------------------------------------------\ +n\n"; print MAIL "Email: $FORM{'Email'}\n"; print MAIL "Subject: $FORM{'Subject'}\n"; if ( $FORM{'Street'} ){ print MAIL "Street: $FORM{'Street'}\n"; } if ( $FORM{'Town'} ){ print MAIL "Town: $FORM{'Town'}\n"; } if ( $FORM{'State'} ){ print MAIL "State: $FORM{'State'}\n"; } if ( $FORM{'Postcode'} ){ print MAIL "Postcode: $FORM{'Postcode'}\n"; } if ( $FORM{'Country'} ){ print MAIL "Country: $FORM{'Country'}\n"; } if ( $FORM{'Telephone'} ){ print MAIL "Telephone: $FORM{'Telephone'}\n"; } if ( $FORM{'Fax'} ){ print MAIL "Fax: $FORM{'Fax'}\n"; } if ( $FORM{'Email2'} ){ print MAIL "Email2: $FORM{'Email2'}\n"; } if ( $FORM{'Car_Type'} ){ print MAIL "Car Type: $FORM{'Car_Type'}\n"; } else { print MAIL "Car Type: $FORM{'car'}\n"; } if ( $FORM{'BabySeats'} ){ print MAIL "Baby Seats: $FORM{'BabySeats'}\n"; } if ( $FORM{'Mvr'} ){ print MAIL "MVR: $FORM{'Mvr'}\n"; } if ( $FORM{'Age'} ){ print MAIL "Age: $FORM{'Age'}\n"; } if ( $FORM{'Passengers'} ){ print MAIL "Passengers: $FORM{'Passengers'}\n"; } if ( $FORM{'Pick-up_Location'} ){ print MAIL "Pick-up Location: $FORM{'Pick-up_Location'}\n"; } if ( $FORM{'pickupdate'} ){ print MAIL "Pick-Up Date: $FORM{'pickupdate'}\n"; }else { print MAIL "Pick-Up Date: $FORM{'PickUpDay'} $FORM{'PickUpMonth'} $ +FORM{'PickUpYear'}\n"; } if ( $FORM{'pickuptime'} ){ print MAIL "Pick-Up Time: $FORM{'pickuptime'}\n"; }else { print MAIL "Pick-Up Time: $FORM{'PickUpHour'}:$FORM{'PickUpMinute'} +\n"; } if ( $FORM{'Drop_Location'} ){ print MAIL "Drop-Off Location: $FORM{'Drop_Location'}\n"; } if ( $FORM{'dropoffdate'} ){ print MAIL "Drop-Off Date: $FORM{'dropoffdate'}\n"; }else { print MAIL "Drop-Off Date: $FORM{'DropOffDay'} $FORM{'DropOffMonth' +} $FORM{'DropOffYear'}\n"; } if ( $FORM{'dropofftime'} ){ print MAIL "Drop-Off Time: $FORM{'dropofftime'}\n"; }else { print MAIL "Drop-Off Time: $FORM{'DropOffHour'}:$FORM{'DropOffMinut +e'}\n"; } if ( $FORM{'DaysRental'} ){ print MAIL "Days Rental: $FORM{'DaysRental'}\n"; } if ( $FORM{'Airline'} ){ print MAIL "Airline: $FORM{'Airline'}\n"; } if ( $FORM{'Flight_Number'} ){ print MAIL "Flight Number: $FORM{'Flight_Number'}\n"; } if ( $FORM{'Arrival_Time'} ){ print MAIL "Arrival Time: $FORM{'Arrival_Time'}\n"; } if ( $FORM{'Travel_Plans'} ){ print MAIL "Travel Plans: $FORM{'Travel_Plans'}\n"; } if ( $FORM{'Comments'} ){ print MAIL "Comments: $FORM{'Comments'}\n"; } if ( $FORM{'CardType'} ){ print MAIL "Card Type: $FORM{'CardType'}\n"; } if ( $FORM{'CardNo'} ){ print MAIL "Card No: $FORM{'CardNo'}\n"; } if ( $FORM{'CardExpiryDate'} ){ print MAIL "Card Expiry: $FORM{'CardExpiryDate'}\n"; } if ( $FORM{'NameOnCard'} ){ print MAIL "Name on Card: $FORM{'NameOnCard'}\n\n"; } print MAIL "------------------------------------------------------\ +n"; print MAIL "Generated by: Carmail.pl\n"; close (MAIL); } if (($remote_mail eq '1') && ($error != 1)) { open (MAIL, "|$mailprog -t") || die "Can't open $mailprog!\n"; print MAIL "To: $FORM{'Email'}\n"; print MAIL "From: $FORM{'MailName'}\@myemail.com\n"; print MAIL "Subject: $FORM{'Subject'}\n\n"; print MAIL "We will advise you soon about your booking.\n\n"; print MAIL "Received from $FORM{'Name'} ($FORM{'Email'}) on $date\n +"; print MAIL "------------------------------------------------------\ +n\n"; print MAIL "Email: $FORM{'Email'}\n"; print MAIL "Subject: $FORM{'Subject'}\n"; if ( $FORM{'Street'} ){ print MAIL "Street: $FORM{'Street'}\n"; } if ( $FORM{'Town'} ){ print MAIL "Town: $FORM{'Town'}\n"; } if ( $FORM{'State'} ){ print MAIL "State: $FORM{'State'}\n"; } if ( $FORM{'Postcode'} ){ print MAIL "Postcode: $FORM{'Postcode'}\n"; } if ( $FORM{'Country'} ){ print MAIL "Country: $FORM{'Country'}\n"; } if ( $FORM{'Telephone'} ){ print MAIL "Telephone: $FORM{'Telephone'}\n"; } if ( $FORM{'Fax'} ){ print MAIL "Fax: $FORM{'Fax'}\n"; } if ( $FORM{'Email2'} ){ print MAIL "Email2: $FORM{'Email2'}\n"; } if ( $FORM{'Car_Type'} ){ print MAIL "Car Type: $FORM{'Car_Type'}\n"; } else { print MAIL "Car Type: $FORM{'car'}\n"; } if ( $FORM{'BabySeats'} ){ print MAIL "Baby Seats: $FORM{'BabySeats'}\n"; } if ( $FORM{'Mvr'} ){ print MAIL "MVR: $FORM{'Mvr'}\n"; } if ( $FORM{'Age'} ){ print MAIL "Age: $FORM{'Age'}\n"; } if ( $FORM{'Passengers'} ){ print MAIL "Passengers: $FORM{'Passengers'}\n"; } if ( $FORM{'Pick-up_Location'} ){ print MAIL "Pick-Up Location: $FORM{'Pick-up_Location'}\n"; } if ( $FORM{'pickupdate'} ){ print MAIL "Pick-Up Date: $FORM{'pickupdate'}\n"; }else { print MAIL "Pick-Up Date: $FORM{'PickUpDay'} $FORM{'PickUpMonth'} $ +FORM{'PickUpYear'}\n"; } if ( $FORM{'pickuptime'} ){ print MAIL "Pick-Up Time: $FORM{'pickuptime'}\n"; }else { print MAIL "Pick-Up Time: $FORM{'PickUpHour'}:$FORM{'PickUpMinute'} +\n"; } if ( $FORM{'Drop_Location'} ){ print MAIL "Drop-Off Location: $FORM{'Drop_Location'}\n"; } if ( $FORM{'dropoffdate'} ){ print MAIL "Drop-Off Date: $FORM{'dropoffdate'}\n"; }else { print MAIL "Drop-Off Date: $FORM{'DropOffDay'} $FORM{'DropOffMonth' +} $FORM{'DropOffYear'}\n"; } if ( $FORM{'dropofftime'} ){ print MAIL "Drop-Off Time: $FORM{'dropofftime'}\n"; }else { print MAIL "Drop-Off Time: $FORM{'DropOffHour'}:$FORM{'DropOffMinut +e'}\n"; } if ( $FORM{'DaysRental'} ){ print MAIL "Days Rental: $FORM{'DaysRental'}\n"; } if ( $FORM{'Airline'} ){ print MAIL "Airline: $FORM{'Airline'}\n"; } if ( $FORM{'Flight_Number'} ){ print MAIL "Flight Number: $FORM{'Flight_Number'}\n"; } if ( $FORM{'Arrival_Time'} ){ print MAIL "Arrival Time: $FORM{'Arrival_Time'}\n"; } if ( $FORM{'Travel_Plans'} ){ print MAIL "Travel Plans: $FORM{'Travel_Plans'}\n"; } if ( $FORM{'Comments'} ){ print MAIL "Comments: $FORM{'Comments'}\n"; } if ( $FORM{'CardType'} ){ print MAIL "Card Type: $FORM{'CardType'}\n"; } if ( $FORM{'CardNo'} ){ print MAIL "Card No: xxxxxxxxxxxxx\n"; } if ( $FORM{'CardExpiryDate'} ){ print MAIL "Card Expiry: xx-xx\n"; } if ( $FORM{'NameOnCard'} ){ print MAIL "Name on Card: $FORM{'NameOnCard'}\n\n"; } print MAIL "------------------------------------------------------\ +n"; print MAIL "Generated by: Carmail.pl\n"; close (MAIL); } # Print Beginning of HTML print <<"END"; <html> <head> <title>Thank You!.</title> </head> <body bgcolor=\"White\" leftmargin=0 topmargin=0 text=\"Black\"> <H1>Thank You, your form has been completed and is now being sent</H1> </body> </html> END } sub censored_word_check { foreach $word (@censor_words) { if ($buffer =~ m/\b$word\b/i) { $error = 1; print <<"END_HTML"; <H1>Internal Server Error</H1> The server encountered an internal error or misconfiguration and was unable to complete your request.<P> Please contact the server administrator, webmaster@sydney-hotels.net and inform them of the time the error occ +urred, and anything you might have done that may have caused the error.<P> More information about this error may be available in the server error log.<P> <P>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle t +he request --. END_HTML exit; } } } sub check_url { # Localize the check_referer flag which determines if user is vali +d. # local($check_referer) = 0; # If a referring URL was specified, for each valid referer, make s +ure # # that a valid referring URL was passed to FormMail. + # if ($ENV{'HTTP_REFERER'}) { foreach $referer (@referers) { if ($ENV{'HTTP_REFERER'} =~ m|https?://([^/]*)$referer|i) +{ $check_referer = 1; last; } } } else { $check_referer = 1; } # If the HTTP_REFERER was invalid, send back an error. + # if ($check_referer != 1) { &error('bad_referer') } }

In reply to Re^3: How to use tr/// by Anonymous Monk
in thread How to use tr/// by ApolloOne

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.