Hey Bernard--
I'm no guru, but I think I can help you with this one...
when you're sending the e-mail to the recipient, the link that it
generates (in this case,
www.aestheticsurgerycenter.com/cgi-bin/postcard/card.cgi1070022045) is
missing a separator for the query string (the 1070022045 part). Find the
portion of the script that puts the message together and add a
question mark between the .cgi and the following varible, and it should work!
hope that helps!
no_guru
Here's the code, I have no experience with Perl. So, maybe can you see which
part of the script puts the message together.
#!D:/Program Files/Perl/bin/perl.exe
########################################################
########################################################
# Don't Edit This CGI Part #
########################################################
########################################################
$i=0;
read(STDIN,$buffer,$ENV{'CONTENT_LENGTH'});
if ($ENV{'QUERY_STRING'})
{$buffer = "$buffer\&$ENV{'QUERY_STRING'}";}
@pairs = split(/&/,$buffer);
foreach $pair (@pairs){
($name,$value) = split(/=/,$pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$VALUE{$name} = $value;
}
############################################
#Gets the Current Date
############################################
($sec,$min,$hr,$day,$month,$year,$day_of_week,$day_of_year,$some) =
localtime(time);
@months =
("January","February","March","April","May","June","July","August","Septembe
r","October","November","December");
$year = $year + 1900;
$DATE = "$months[$month]-$day";
$SHORTDATE = "$months[$month] $day, $year at $hr:$min:$sec";
############################################
#Gets Picture Data and Moves on to Next Page
############################################
if ($VALUE{'action'} eq 'preview') {
$pic = $VALUE{'PICTURES'};
$VALUE{'PICTURE'} = $VALUE{'PICTURES'};
$VALUE{'PICTURES'} = "$basepicurl$pic";
print "Content-type: text/html\n\n";
open(TEMPLATE,"$preview1");
&template;
print $template;
exit;
}
#########################
#Prints the Preview Page
#########################
if ($VALUE{'action'} eq 'preview1') {
$pic = $VALUE{'PICTURE'};
$VALUE{'PICTURES'} = "$basepicurl$pic";
$VALUE{'MESSAGE'} =~ s/\r//g;
$VALUE{'MESSAGE'} =~ s/\<[^\>]*\>//ig;
$VALUE{'MESSAGE'} =~ s/"/'/g;
$VALUE{'MESSAGE'} =~ s/\n/<BR>/g;
print "Content-type: text/html\n\n";
open(TEMPLATE,"$preview2");
&template;
print $template;
exit;
}
##########
#Send Card
##########
if ($VALUE{'action'} eq 'send') {
&no_email unless $VALUE{'MAILFROM'} && $VALUE{'MAILTO'};
######################
#Save the Data
######################
$date = time;
$create_card = "$cards$date.dat";
open(DATA, ">>$create_card");
print DATA
"$VALUE{'SENDER'}|$VALUE{'MAILFROM'}|$VALUE{'RECIPIENT'}|$VALUE{'MAILTO'}|$V
ALUE{'MESSAGE'}|$VALUE{'PICTURE'}|0\n";
close(DATA);
$url_of_card = "$cgi?$date";
##########################
#Print Thank You HTML
##########################
print "Content-type: text/html\n\n";
open(TEMPLATE,"$thank_you");
&template;
print $template;
$template = '';
##########################
#Send E-mail to Recipient
##########################
open (MAIL, "|$mailprog -t") || die "Kan $mailprog niet openen!\n";
print MAIL "To: $VALUE{'MAILTO'} ($VALUE{'RECIPIENT'})\n";
print MAIL "From: $VALUE{'MAILFROM'} ($VALUE{'SENDER'})\n";
print MAIL "Subject: $VALUE{'RECIPIENT'}, $subject1\n\n";
open(TEMPLATE,"$email1");
&template;
print MAIL $template;
print MAIL ".\n" ;
close(MAIL);
$deletes = "$cards$DATE.dat";
if(-e $deletes){
}
else{
open(DATA, ">>$deletes");
close(DATA);
&delete;
}
exit;
}
########################
#No E-Mail Addresses
########################
sub no_email {
print "Content-type: text/html\n\n";
print "<HTML>\n<TITLE>Fout! E-Mail adres niet geldig</TITLE>\n";
print "<BODY COLOR=\"#FFFFFF\">\n";
print "Kan niet verstuurd worden!<BR>\n";
print "<B>[Mogelijke oorzaken:]</B><BR>\n";
print " 1.) U bent beide e-mail adressen vergeten in te
vullen<BR>";
print " 2.) E-Mail Adres(en) niet in de goed formaat ingetypt,
<B>b.v. (e-mail address removed)</B>";
exit;
}
#######################################
#Creates the Postcard
#######################################
if ($ENV{'QUERY_STRING'}) {
############################################
#Makes Postcards and Sends Thank You E-mail
############################################
$create_card = "$cards$ENV{'QUERY_STRING'}.dat";
if(-e $create_card){
open(DATA, "$create_card");
@data = <DATA>;
close(DATA);
foreach $temp (@data){
chop($temp);
($SENDER, $MAILFROM, $RECIPIENT, $MAILTO, $MESSAGE, $PICTURES, $COUNT) =
split(/\|/, $temp);
$VALUE{'SENDER'} = $SENDER;
$VALUE{'MAILFROM'} = $MAILFROM;
$VALUE{'RECIPIENT'} = $RECIPIENT;
$VALUE{'MAILTO'} = $MAILTO;
$VALUE{'MESSAGE'} = $MESSAGE;
$VALUE{'MESSAGE'} =~ s/ / /g;
$VALUE{'PICTURES'} = "$basepicurl$PICTURES";
$VALUE{'LINK'} = "$link$LINK";
$VALUE{'PICTURE'} = "$basepicurl$PICTURES";
}
unlink("$create_card");
open(DATA, ">>$create_card");
$COUNT++;
print DATA
"$SENDER|$MAILFROM|$RECIPIENT|$MAILTO|$MESSAGE|$PICTURES|$COUNT\n";
close(DATA);
print "Content-type: text/html\n\n";
open(TEMPLATE,"$makecard");
&template;
print $template;
$template = '';
if($COUNT eq '1'){
open (MAIL, "|$mailprog -t") || die "Kan $mailprog niet openen!\n";
print MAIL "To: $VALUE{'MAILFROM'} ($VALUE{'SENDER'})\n";
print MAIL "From: $VALUE{'MAILTO'} ($VALUE{'RECIPIENT'})\n";
print MAIL "Subject: $subject2\n\n";
open(TEMPLATE,"$email2");
&template;
print MAIL $template;
print MAIL ".\n" ;
close(MAIL);
}
}
else {
print "Content-type: text/html\n\n";
open(TEMPLATE,"$error");
&template;
print $template;
}
exit;
}
#######################################
#DELETES the information
#######################################
sub delete {
local(@items, $pair);
opendir(DELETE, "$cards");
@items = grep(/.dat/,readdir(DELETE));
closedir(DELETE);
foreach $pair (@items){
if (-M "$cards$pair" > $MAX_DAYS){
unlink("$cards$pair");
}
}
}
#####################
#Calls the Template
#####################
sub template {
while (<TEMPLATE>){
$template .= $_;
}
close(TEMPLATE);
$template =~ s/\%%%PICTURES%%%/$VALUE{'PICTURES'}/g;
$template =~ s/\%%%PICTURE%%%/$VALUE{'PICTURE'}/g;
$template =~ s/\%%%SENDER%%%/$VALUE{'SENDER'}/g;
$template =~ s/\%%%MAILFROM%%%/$VALUE{'MAILFROM'}/g;
$template =~ s/\%%%MAILTO%%%/$VALUE{'MAILTO'}/g;
$template =~ s/\%%%RECIPIENT%%%/$VALUE{'RECIPIENT'}/g;
$template =~ s/\%%%MESSAGE%%%/$VALUE{'MESSAGE'}/g;
$template =~ s/\%%%CGI%%%/$cgi/g;
$template =~ s/\%%%MAX_DAYS%%%/$MAX_DAYS/g;
$template =~ s/\%%%SHORTDATE%%%/$SHORTDATE/g;
$template =~ s/\%%%url_of_card%%%/$url_of_card/g;
}
Thx,
Bernard