Geachte tweakers,
Bij deze wil ik jullie hulp inroepen.
Gezien het feit dat ik geen script request mag doen, heb ik het anders aangepakt. Ik ben gaan hobby-en met een script, wat ik heb aangepast naar eigen hand.
Natuurlijk werkt dat niet in één keer. vandaar dat ik nu hier uit kom.
Het gaat om het volgende script:
#/cgi-bin/awardmail.pl
# location of Perl (above) - check your doc or ask admin
#############################################################
#
# Script Source: CodeBrain.com
# Source URL: http://www.codebrain.com/perl
# Script Title: Award Submission E-Mailer w/ Autoresponder
# Script Name: AwardMail.pl
# Copyright: 1998,1999,2000 by OEC Corp & CodeBrain.com
# Version: 09.01.1999.C (latest)
# Status: Fully tested, release version 7, updated
#
# This script may not be redistributed without this header
#
# There are no restrictions on this script - anyone may use
# it, though we appreciate credit where due. Responsibility
# for use of the script is entirely with the user. Please
# note that CodeBrain.com does NOT support Perl scripts!
#
# Instructions:
#
# - Use WordPad.exe or any text editor to edit
# - Set your path to Perl as needed (first line at top)
# - Set ALL variables appropriately (below, see notes)
# - Take special care with the path to your sendmail (below)
# - Send the script to the server in ascii
# - Set script permissions - check your doc or ask admin
# - See e_faq.html for HTML set-ups in awardmail.zip file
# - Required html pages are also provided in awardmail.zip
#
#############################################################
##### SETTABLE VARIABLES ####################################
# URL to go to if there is a problem with form input
$ErrorPage = "http://www.lindware.nl/404.htm";
# URL to go to when form has been successfully submitted
$ThankPage = "http://www.lindware.nl/bedankt.htm";
# URL to go to if a 'foreign' referer calls the script
$EvilReferer = "http://www.networking4all.nl";
# E-mail address to send incoming form to (your address)
# If not using PERL 5, escape the @ thus: \@ instead of @
$YourEmail = 'info@lindware.nl';
# Script works only on your server(s) - ('URL1','URL2')
@referers = ('www.vahvideo.nl','www.vahvideo.nl');
# Location of mail program - check your doc or ask admin
$MailProgram = '/cgi-bin/awardmail.pl';
# Subject of the e-mail autoreply to the submitter
$Subject = "Bedankt voor het aanvragen van informatie...";
# Brief tail message for body of e-mail autoreply
$Message = "Geachte Heer/mevrouw,
Bedankt voor uw vertrouwen in ons product.
U krijgt zo spoedig mogelijk bericht.
Met vriendelijke groet,
naam
__________________________________________
Dit is een automatisch gegenereerd bericht";
# Your signature at the end of the autoreply e-mail
$Signature = "www.vahvideo.nl";
##### END OF SETTABLE VARIABLES ############################
##### MAIN PROGRAM #########################################
# ___ Do not edit below this line __________________________
&CheckReferingURL;
&ReadParse;
$Name = $in{'Name'};
$Email = $in{'Email'};
$URL = $in{'URL'};
$SiteName = $in{'SiteName'};
$Description = $in{'Description'};
&CheckEmailAddressFormat;
&CheckFields;
&SendSubmission;
&SendAutoReply;
print "Location: $ThankPage\n\n";
exit;
# _________________________________________________________
sub SendSubmission {
open (MAIL,"|$MailProgram -t");
print MAIL "To: $YourEmail\n";
print MAIL "From: $Email\n";
print MAIL "Subject: AWARD SUBMISSION\n";
print MAIL "AWARD SUBMISSION\n\n";
print MAIL "From: $Name\n";
print MAIL "Email: $Email\n";
print MAIL "Site: $SiteName\n";
print MAIL "URL: $URL\n\n";
print MAIL "Description:\n";
print MAIL "$Description\n\n";
close (MAIL);
}
# _________________________________________________________
sub SendAutoReply {
open (MAIL,"|$MailProgram -t");
print MAIL "To: $Email\n";
print MAIL "From: $YourEmail\n";
print MAIL "Subject: $Subject\n";
print MAIL "$Subject\n\n";
print MAIL "You sent the following information:\n\n";
print MAIL "Name: $Name\n";
print MAIL "Email: $Email\n";
print MAIL "Site: $SiteName\n";
print MAIL "URL: $URL\n";
print MAIL "Description:\n";
print MAIL "$Description\n\n";
print MAIL "$Message\n\n";
print MAIL "Best regards,\n\n\n";
print MAIL "$Signature\n\n";
close (MAIL);
}
# _________________________________________________________
sub ReadParse { local (*in) = @_ if @_;
local ($i, $key, $val); if ( $ENV{'REQUEST_METHOD'} eq "GET" )
{$in = $ENV{'QUERY_STRING'};}
elsif ($ENV{'REQUEST_METHOD'} eq "POST")
{read(STDIN,$in,$ENV{'CONTENT_LENGTH'});}
else {
$in = ( grep( !/^-/, @ARGV )) [0];
$in =~ s/\\&/&/g; } @in = split(/&/,$in);
foreach $i (0 .. $#in) {
$in[$i] =~ s/\+/ /g;
($key, $val) = split(/=/,$in[$i],2);
$key =~ s/%(..)/pack("c",hex($1))/ge;
$val =~ s/%(..)/pack("c",hex($1))/ge;
$in{$key} .= "\0" if (defined($in{$key}));
$in{$key} .= $val; } return length($in); }
# _________________________________________________________
sub CheckEmailAddressFormat {
if (index($Email, "@") < 1) {&DoEmailError;}
if (index($Email, ".") < 1) {&DoEmailError;}
if (index($Email, " ") > -1) {&DoEmailError;}
}
sub CheckFields {
if (!$Name || $Name eq ' ') {&DoEmailError;}
if (!$Email || $Email eq ' ') {&DoEmailError;}
if (!$SiteName || $SiteName eq ' ') {&DoEmailError;}
if (!$URL || $URL eq ' ') {&DoEmailError;}
if (!$Description || $Description eq ' ') {&DoEmailError;}
}
sub DoEmailError {
print "Location: $ErrorPage\n\n";
exit;
}
# _________________________________________________________
sub CheckReferingURL {
if ($ENV{'HTTP_REFERER'}) {
foreach $referer (@referers) {
if ($ENV{'HTTP_REFERER'} =~ /$referer/i) {
$check_referer = '1';
last;
}}}
else {$check_referer = '1';}
if ($check_referer != 1) {
print "Location: $EvilReferer\n\n";
exit;
}}
# _________________________________________________________
exit;
##### End of Script ########################################
Nu heb ik het script op op deze locatie gezet:
http://www.lindware.nl/cgi-bin/awardmail.pl
het formulier wat ik heb geconfigureerd draait op http://www.lindware.nl/kcontact.html (als test)
als je op verzenden drukt krijg ik de volgende foutmelding:
Server fout!
Foutbericht:
Premature end of script headers: awardmail.pl
Platform van de server is linux (red-hat) en ondersteund perl.
verder is het gehost bij www.networking4all.com
Zelf denk ik dat er iets rammeld in het script maar ik heb daar te wienig verstand van om daarover te oordelen.
Iemand een idee?
Bij deze wil ik jullie hulp inroepen.
Gezien het feit dat ik geen script request mag doen, heb ik het anders aangepakt. Ik ben gaan hobby-en met een script, wat ik heb aangepast naar eigen hand.
Natuurlijk werkt dat niet in één keer. vandaar dat ik nu hier uit kom.
Het gaat om het volgende script:
#/cgi-bin/awardmail.pl
# location of Perl (above) - check your doc or ask admin
#############################################################
#
# Script Source: CodeBrain.com
# Source URL: http://www.codebrain.com/perl
# Script Title: Award Submission E-Mailer w/ Autoresponder
# Script Name: AwardMail.pl
# Copyright: 1998,1999,2000 by OEC Corp & CodeBrain.com
# Version: 09.01.1999.C (latest)
# Status: Fully tested, release version 7, updated
#
# This script may not be redistributed without this header
#
# There are no restrictions on this script - anyone may use
# it, though we appreciate credit where due. Responsibility
# for use of the script is entirely with the user. Please
# note that CodeBrain.com does NOT support Perl scripts!
#
# Instructions:
#
# - Use WordPad.exe or any text editor to edit
# - Set your path to Perl as needed (first line at top)
# - Set ALL variables appropriately (below, see notes)
# - Take special care with the path to your sendmail (below)
# - Send the script to the server in ascii
# - Set script permissions - check your doc or ask admin
# - See e_faq.html for HTML set-ups in awardmail.zip file
# - Required html pages are also provided in awardmail.zip
#
#############################################################
##### SETTABLE VARIABLES ####################################
# URL to go to if there is a problem with form input
$ErrorPage = "http://www.lindware.nl/404.htm";
# URL to go to when form has been successfully submitted
$ThankPage = "http://www.lindware.nl/bedankt.htm";
# URL to go to if a 'foreign' referer calls the script
$EvilReferer = "http://www.networking4all.nl";
# E-mail address to send incoming form to (your address)
# If not using PERL 5, escape the @ thus: \@ instead of @
$YourEmail = 'info@lindware.nl';
# Script works only on your server(s) - ('URL1','URL2')
@referers = ('www.vahvideo.nl','www.vahvideo.nl');
# Location of mail program - check your doc or ask admin
$MailProgram = '/cgi-bin/awardmail.pl';
# Subject of the e-mail autoreply to the submitter
$Subject = "Bedankt voor het aanvragen van informatie...";
# Brief tail message for body of e-mail autoreply
$Message = "Geachte Heer/mevrouw,
Bedankt voor uw vertrouwen in ons product.
U krijgt zo spoedig mogelijk bericht.
Met vriendelijke groet,
naam
__________________________________________
Dit is een automatisch gegenereerd bericht";
# Your signature at the end of the autoreply e-mail
$Signature = "www.vahvideo.nl";
##### END OF SETTABLE VARIABLES ############################
##### MAIN PROGRAM #########################################
# ___ Do not edit below this line __________________________
&CheckReferingURL;
&ReadParse;
$Name = $in{'Name'};
$Email = $in{'Email'};
$URL = $in{'URL'};
$SiteName = $in{'SiteName'};
$Description = $in{'Description'};
&CheckEmailAddressFormat;
&CheckFields;
&SendSubmission;
&SendAutoReply;
print "Location: $ThankPage\n\n";
exit;
# _________________________________________________________
sub SendSubmission {
open (MAIL,"|$MailProgram -t");
print MAIL "To: $YourEmail\n";
print MAIL "From: $Email\n";
print MAIL "Subject: AWARD SUBMISSION\n";
print MAIL "AWARD SUBMISSION\n\n";
print MAIL "From: $Name\n";
print MAIL "Email: $Email\n";
print MAIL "Site: $SiteName\n";
print MAIL "URL: $URL\n\n";
print MAIL "Description:\n";
print MAIL "$Description\n\n";
close (MAIL);
}
# _________________________________________________________
sub SendAutoReply {
open (MAIL,"|$MailProgram -t");
print MAIL "To: $Email\n";
print MAIL "From: $YourEmail\n";
print MAIL "Subject: $Subject\n";
print MAIL "$Subject\n\n";
print MAIL "You sent the following information:\n\n";
print MAIL "Name: $Name\n";
print MAIL "Email: $Email\n";
print MAIL "Site: $SiteName\n";
print MAIL "URL: $URL\n";
print MAIL "Description:\n";
print MAIL "$Description\n\n";
print MAIL "$Message\n\n";
print MAIL "Best regards,\n\n\n";
print MAIL "$Signature\n\n";
close (MAIL);
}
# _________________________________________________________
sub ReadParse { local (*in) = @_ if @_;
local ($i, $key, $val); if ( $ENV{'REQUEST_METHOD'} eq "GET" )
{$in = $ENV{'QUERY_STRING'};}
elsif ($ENV{'REQUEST_METHOD'} eq "POST")
{read(STDIN,$in,$ENV{'CONTENT_LENGTH'});}
else {
$in = ( grep( !/^-/, @ARGV )) [0];
$in =~ s/\\&/&/g; } @in = split(/&/,$in);
foreach $i (0 .. $#in) {
$in[$i] =~ s/\+/ /g;
($key, $val) = split(/=/,$in[$i],2);
$key =~ s/%(..)/pack("c",hex($1))/ge;
$val =~ s/%(..)/pack("c",hex($1))/ge;
$in{$key} .= "\0" if (defined($in{$key}));
$in{$key} .= $val; } return length($in); }
# _________________________________________________________
sub CheckEmailAddressFormat {
if (index($Email, "@") < 1) {&DoEmailError;}
if (index($Email, ".") < 1) {&DoEmailError;}
if (index($Email, " ") > -1) {&DoEmailError;}
}
sub CheckFields {
if (!$Name || $Name eq ' ') {&DoEmailError;}
if (!$Email || $Email eq ' ') {&DoEmailError;}
if (!$SiteName || $SiteName eq ' ') {&DoEmailError;}
if (!$URL || $URL eq ' ') {&DoEmailError;}
if (!$Description || $Description eq ' ') {&DoEmailError;}
}
sub DoEmailError {
print "Location: $ErrorPage\n\n";
exit;
}
# _________________________________________________________
sub CheckReferingURL {
if ($ENV{'HTTP_REFERER'}) {
foreach $referer (@referers) {
if ($ENV{'HTTP_REFERER'} =~ /$referer/i) {
$check_referer = '1';
last;
}}}
else {$check_referer = '1';}
if ($check_referer != 1) {
print "Location: $EvilReferer\n\n";
exit;
}}
# _________________________________________________________
exit;
##### End of Script ########################################
Nu heb ik het script op op deze locatie gezet:
http://www.lindware.nl/cgi-bin/awardmail.pl
het formulier wat ik heb geconfigureerd draait op http://www.lindware.nl/kcontact.html (als test)
als je op verzenden drukt krijg ik de volgende foutmelding:
Server fout!
Foutbericht:
Premature end of script headers: awardmail.pl
Platform van de server is linux (red-hat) en ondersteund perl.
verder is het gehost bij www.networking4all.com
Zelf denk ik dat er iets rammeld in het script maar ik heb daar te wienig verstand van om daarover te oordelen.
Iemand een idee?