UNKNOWN
=**************************************
= Name: Send an Message to an ICQ account without ICQ!
= Description:I found this code on the web(source forgotten - my bad), and made minimal changes to it. This allows you to send a message to an ICQ Account.
= By: Brandon McPherson
=
=
= Inputs:It's all self-contained.
=
= Returns:HTML
=
=Assumes:None
=
=Side Effects:Excessive hair growth :)
=This code is copyrighted and has limited warranties.
=Please see http://www.Planet-Source-Code.com/xq/ASP/txtCodeId.142/lngWId.6/qx/vb/scripts/ShowCode.htm
=for details.
=**************************************
#!/usr/bin/perl
my $TITLE = "Page me on ICQ!";
my $BGCOLOR = "#FFCC00";
my $TEXT_COLOR_NORMAL = "#000000";
my $REQUIRED_TEXT_COLOR = "Black";
my $BACKGROUND_URL = "";
my $CGI_DIR = "http://www.servername.com/cgi-bin";
$SHOW_OPTIONAL_FIELDS = 0;
my $sendmail = "/usr/sbin/sendmail";
my $destination_email = "1234567\@pager.icq.com";
&print;_header;
&get;_form_data;
if (!$FORM_DATA{'mail'}) {
&print;_html_form;
} else {
$error = 0;
✓_form_data;
if (!$error) {
&send;_mail;
&reply;_to_user;
}
}
exit(0);
sub print_header {
print ("Content-type: text/html\n\n");
print ("\n
\n$TITLE\n\n");
print ("\n");
}#print_header
sub get_form_data {
$request_method = $ENV{'REQUEST_METHOD'};
if ($request_method eq "GET") {
$form_info = $ENV{'QUERY_STRING'};
} else {
$size_of_form_information = $ENV{'CONTENT_LENGTH'};
read (STDIN, $form_info, $size_of_form_information);
}
@key_value_pairs = split (/&/, $form_info);
foreach $key_value (@key_value_pairs) {
($key, $value) = split (/=/, $key_value);
$value =~ tr/+/ /;
$value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg;
if (defined($FORM_DATA{$key})) {
$FORM_DATA{$key} = join (", ", $FORM_DATA{$key}, $value);
} else {
$FORM_DATA{$key} = $value;
}
}
} #get_form_data
sub print_html_form {
print <<__END_OF_HTML_CODE__;
__END_OF_HTML_CODE__
} #print_html_form
sub check_form_data {
my %error_codes = (
"1" => "You need to enter your email address.",
"2" => "You seemed to have forgotten to enter the
email message you wish to send.",
"3" =>"For security reasons, you cannot have any of the following characters in your email or subject fields: [ ; < > & \* ` \| ] "
);
if ($FORM_DATA{'users_email'} !~ /\@/ &&
$FORM_DATA{'users_email'} !~ /\w/) {
$error = 1;
} elsif ($FORM_DATA{'message'} !~ /\w/) {
$error = 2;
}
if (($FORM_DATA{"subject"} =~ /[\[\;\>\<\&\*\^\$\(\)\`\|\]\']/) || ($FORM_DATA{"to"} =~ /[\[\;\>\<\&\*\^\$\(\)\`\|\]\']/)
|| ($FORM_DATA{"users_email"} =~ /[\[\;\>\<\&\*\^\$\(\)\`\|\]\']/)) {
$error = 3;
}
if ($error) {
print ("
\n");
print ("D'OH! ");
print ("We had a little mishap. This is why: \n");
print (" $error_codes{$error}\n \n ");
print ("Please hit the back button in your browser to ");
print ("correct this. Thank you!\n");
print ("