Perlwannabe
Technical User
Hi everyone,
I have a script that comes with an autoresponder:It sends messages to everyone submits a certan url,instantly;I would prevent that since I would send these messages manually in a second time:How could I "break" the code in order to get this result?
Thanks for any help.
This is the code block:
sub addurl {
&heading;
$noshow = 1;
unless ($FORM{'url'} =~ /http:\/\//) {
&submiterror;
}
if ($FORM{'url'} eq "" || $FORM{'title'} eq "" || $FORM{'email'} eq "" || $FORM{'description'} eq "" || $FORM{'keywords'} eq "") {
#∅
}
unless (open (DATA,"$base")) {die (&error);}
if ($uselock eq '1') {
flock DATA, 2;
seek DATA, 0, 0;
}
@input = <DATA>;
if ($uselock eq '1') {
flock DATA, 8;
}
close (DATA);
$entries = @input;
$urlsearch = "$FORM{'url'}"."::";
$urltemp = $FORM{'url'};
chomp($urltemp);
chop($urltemp);
$urlsearchtwo = "$urltemp"."::";
$urlsearchthree = "$FORM{'url'}"."/::";
$currentline = 0;
until ($currentline == $entries) {
#if ($input[$currentline] =~ /$urlsearch/i) {
# &exists;
#}
#if ($input[$currentline] =~ /$urlsearchtwo/i) {
# &exists;
#}
#if ($input[$currentline] =~ /$urlsearchthree/i) {
# &exists;
#}
++$currentline;
}
$testline = $input[$currentline-1];
$testline2 = $input[$currentline-2];
$testline3 = $input[$currentline-3];
$testline4 = $input[$currentline-4];
$testline5 = $input[$currentline-5];
$testline6 = $input[$currentline-6];
$testline7 = $input[$currentline-7];
$testline8 = $input[$currentline-8];
$testline9 = $input[$currentline-9];
$testline10 = $input[$currentline-10];
#if ($testline =~ /$FORM{'description'}/) {
# &samestuff;
#}
#if ($testline =~ /$FORM{'title'}/) {
# &samestuff;
#}
#if ($testline =~ /$FORM{'keywords'}/) {
# &samestuff;
#}
#if ($testline =~ /$FORM{'email'}/i || $testline2 =~ /$FORM{'email'}/i || $testline3 =~ /$FORM{'email'}/i || $testline4 =~ /$FORM{'email'}/i || $testline5 =~ /$FORM{'email'}/i || $testline6 =~ /$FORM{'email'}/i || $testline7 =~ /$FORM{'email'}/i || $testline8 =~ /$FORM{'email'}/i || $testline9 =~ /$FORM{'email'}/i || $testline10 =~ /$FORM{'email'}/i) {
# &justsubmitted;
#}
$newemail = $FORM{'email'};
if ($FORM{'send'} ne "on") {
$newemail = "X"."$newemail"."X";
}
$newtitle = substr($FORM{'title'},0,$maxtitle);
$newdesc = substr($FORM{'description'},0,$maxdescription);
$newkeywords = substr($FORM{'keywords'},0,$maxkeywords);
$line = join ("::","$FORM{'url'}","$newtitle","$newkeywords","$newemail","$newdesc");
unless (open (DATA,">>$base")) {die (&error);}
if ($uselock eq '1') {
flock DATA, 2;
seek DATA, 0, 2;
}
print DATA "$line\n";
if ($uselock eq '1') {
flock DATA, 8;
}
close (DATA);
print "<center><HR WIDTH=400><FONT $font SIZE=3><b>Submission Received</b></font><p>\n";
if ($userespond eq '1') {
unless (open (DATA,"$respondfile")) {die (&error);}
if ($uselock eq '1') {
flock DATA, 2;
seek DATA, 0, 0;
}
@respondinfo = <DATA>;
if ($uselock eq '1') {
flock DATA, 8;
}
close (DATA);
foreach $respondline (@respondinfo){
$respondmessage = $respondmessage.$respondline;
}
open (MAIL, "|$mailprogram -t");
print MAIL "To: $FORM{'email'}\n";
print MAIL "From: $searchemail\n";
print MAIL "Subject: Got it!\n\n";
print MAIL "Welcome to $sitetitle!\n";
print MAIL "We are located at $searchurl\n\n";
print MAIL "YOUR SUBMISSION:\n";
print MAIL "------------------------------------------------------------------\n";
print MAIL "URL : $FORM{'url'}\n";
print MAIL "Title : $FORM{'title'}\n";
print MAIL "Description : $FORM{'description'}\n";
print MAIL "Keywords : $FORM{'keywords'}\n";
print MAIL "E-mail : $FORM{'email'}\n";
print MAIL "------------------------------------------------------------------\n\n";
print MAIL "$respondmessage";
print MAIL "------------------------------------------------------------------\n\n";
print MAIL "Thanks again,\n";
print MAIL "---------------------------------------------\n";
print MAIL "$sitetitle\n";
print MAIL "$searchemail\n";
print MAIL "$searchurl\n";
print MAIL "---------------------------------------------\n";
print MAIL "Powered by :\n";
print MAIL "---------------------------------------------\n";
close (MAIL);
}
&footer;
I have a script that comes with an autoresponder:It sends messages to everyone submits a certan url,instantly;I would prevent that since I would send these messages manually in a second time:How could I "break" the code in order to get this result?
Thanks for any help.
This is the code block:
sub addurl {
&heading;
$noshow = 1;
unless ($FORM{'url'} =~ /http:\/\//) {
&submiterror;
}
if ($FORM{'url'} eq "" || $FORM{'title'} eq "" || $FORM{'email'} eq "" || $FORM{'description'} eq "" || $FORM{'keywords'} eq "") {
#∅
}
unless (open (DATA,"$base")) {die (&error);}
if ($uselock eq '1') {
flock DATA, 2;
seek DATA, 0, 0;
}
@input = <DATA>;
if ($uselock eq '1') {
flock DATA, 8;
}
close (DATA);
$entries = @input;
$urlsearch = "$FORM{'url'}"."::";
$urltemp = $FORM{'url'};
chomp($urltemp);
chop($urltemp);
$urlsearchtwo = "$urltemp"."::";
$urlsearchthree = "$FORM{'url'}"."/::";
$currentline = 0;
until ($currentline == $entries) {
#if ($input[$currentline] =~ /$urlsearch/i) {
# &exists;
#}
#if ($input[$currentline] =~ /$urlsearchtwo/i) {
# &exists;
#}
#if ($input[$currentline] =~ /$urlsearchthree/i) {
# &exists;
#}
++$currentline;
}
$testline = $input[$currentline-1];
$testline2 = $input[$currentline-2];
$testline3 = $input[$currentline-3];
$testline4 = $input[$currentline-4];
$testline5 = $input[$currentline-5];
$testline6 = $input[$currentline-6];
$testline7 = $input[$currentline-7];
$testline8 = $input[$currentline-8];
$testline9 = $input[$currentline-9];
$testline10 = $input[$currentline-10];
#if ($testline =~ /$FORM{'description'}/) {
# &samestuff;
#}
#if ($testline =~ /$FORM{'title'}/) {
# &samestuff;
#}
#if ($testline =~ /$FORM{'keywords'}/) {
# &samestuff;
#}
#if ($testline =~ /$FORM{'email'}/i || $testline2 =~ /$FORM{'email'}/i || $testline3 =~ /$FORM{'email'}/i || $testline4 =~ /$FORM{'email'}/i || $testline5 =~ /$FORM{'email'}/i || $testline6 =~ /$FORM{'email'}/i || $testline7 =~ /$FORM{'email'}/i || $testline8 =~ /$FORM{'email'}/i || $testline9 =~ /$FORM{'email'}/i || $testline10 =~ /$FORM{'email'}/i) {
# &justsubmitted;
#}
$newemail = $FORM{'email'};
if ($FORM{'send'} ne "on") {
$newemail = "X"."$newemail"."X";
}
$newtitle = substr($FORM{'title'},0,$maxtitle);
$newdesc = substr($FORM{'description'},0,$maxdescription);
$newkeywords = substr($FORM{'keywords'},0,$maxkeywords);
$line = join ("::","$FORM{'url'}","$newtitle","$newkeywords","$newemail","$newdesc");
unless (open (DATA,">>$base")) {die (&error);}
if ($uselock eq '1') {
flock DATA, 2;
seek DATA, 0, 2;
}
print DATA "$line\n";
if ($uselock eq '1') {
flock DATA, 8;
}
close (DATA);
print "<center><HR WIDTH=400><FONT $font SIZE=3><b>Submission Received</b></font><p>\n";
if ($userespond eq '1') {
unless (open (DATA,"$respondfile")) {die (&error);}
if ($uselock eq '1') {
flock DATA, 2;
seek DATA, 0, 0;
}
@respondinfo = <DATA>;
if ($uselock eq '1') {
flock DATA, 8;
}
close (DATA);
foreach $respondline (@respondinfo){
$respondmessage = $respondmessage.$respondline;
}
open (MAIL, "|$mailprogram -t");
print MAIL "To: $FORM{'email'}\n";
print MAIL "From: $searchemail\n";
print MAIL "Subject: Got it!\n\n";
print MAIL "Welcome to $sitetitle!\n";
print MAIL "We are located at $searchurl\n\n";
print MAIL "YOUR SUBMISSION:\n";
print MAIL "------------------------------------------------------------------\n";
print MAIL "URL : $FORM{'url'}\n";
print MAIL "Title : $FORM{'title'}\n";
print MAIL "Description : $FORM{'description'}\n";
print MAIL "Keywords : $FORM{'keywords'}\n";
print MAIL "E-mail : $FORM{'email'}\n";
print MAIL "------------------------------------------------------------------\n\n";
print MAIL "$respondmessage";
print MAIL "------------------------------------------------------------------\n\n";
print MAIL "Thanks again,\n";
print MAIL "---------------------------------------------\n";
print MAIL "$sitetitle\n";
print MAIL "$searchemail\n";
print MAIL "$searchurl\n";
print MAIL "---------------------------------------------\n";
print MAIL "Powered by :\n";
print MAIL "---------------------------------------------\n";
close (MAIL);
}
&footer;