cgi-script virker ikke?
Hola!(Tag det roligt, jeg er spejlblank når det kommer til cgi/perl!)
Dette script virker fint på den ene server, men ikke på den anden: (Den nye server understøtter cgi/perl)
#!/usr/local/bin/perl -w
##############################################################################
# SimpleMail Version 0.8 #
# History : EK 2000-05 : Modelled from A-1 WebSite Specific Registration #
##############################################################################
require "/usr/local/lib/cgi-lib.pl";
$mailprog = '/usr/lib/sendmail';
#$recipient = 'svn@foobar.nu';
#$recipient = 'svn@foobar.nu';
&ReadParse(*input);
$template = "template";
$contentmarker = '<!--content-->';
$storage = "data.dat";
print "content-type: text/html\n\n";
unless ($input{'email'} =~ /.+\@.+\..+/) {
&output();
die;
}
$details = "$input{'email'}\#$input{'fornavn'}\#$input{'efternavn'}\#$input{'adresse'}\#$input{'postnr'}\#$input{'by'}\#$input{'contest'}\#$input{'format'}\#$input{'ok_reg'}\#$input{'sm'}\#$input{'question1'}\n";
open (STORE,"$storage");
@store = <STORE>;
close (STORE);
$update = 0;
foreach $line (@store) {
if ($line =~ /^$input{'email'}\#/i) {
$line = $details;
$update = 1;
last;
}
}
if ($update) {
open (STORE,">$storage");
foreach $line (@store) {
print STORE $line;
}
} else {
open (STORE,">>$storage");
print STORE $details;
}
close (STORE);
if ($update) {
&output();
} else {
&output();
}
if ($input{'comment_type'} =~ /^[A-Z,a-z,' ']+/) {
&send_mail();
&output();
}
sub output {
open (TEMP,"$template");
@temp = <TEMP>;
close (TEMP);
foreach $line (@temp) {
$line =~ s/$contentmarker/$_[0]/;
print $line;
}
}
sub send_mail {
# Localize variables used in this subroutine. #
# local($recipient2);
#
# # Open The Mail Program
# open(MAIL,"|$mailprog -t");
#
# print MAIL "To: $recipient\n";
# print MAIL "From: SOAP\n";
# print MAIL "Subject: $input{'comment_type'} : $input{'comment_scope'}\n\n";
# print MAIL "The following information was delivered from the feedback form:\n";
# print MAIL "-" x 75 . "\n";
# print MAIL "Comment Type : $input{'comment_type'}\n";
# print MAIL "Comment Scope : $input{'comment_scope'}\n";
# print MAIL "Email : $input{'email'}\n";
# print MAIL "Name : $input{'firstname'},$input{'lastname'}\n";
# print MAIL "-" x 75 . "\n\n";
# print MAIL "$input{'comment_full'}\n";
# close (MAIL);
}
