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";
print "<FONT $font SIZE=2><B>The following submission has been received by $sitetitle :</B></font><br>\n";
print "<table width=400><tr><td align=right><FONT $font SIZE=2><B>URL :</B></font></td>\n";
print "<td><a href=\"$FORM{'url'}\"><FONT $font SIZE=2><b>$FORM{'url'}</b></font></a></td></tr>\n";
print "<tr><td align=right><FONT $font SIZE=2><B>Title :</B></font></td><td><FONT $font SIZE=2> $FORM{'title'}</td></tr>\n";
print "<tr><td align=right><FONT $font SIZE=2><B>Keywords :</B></font></td><td><FONT $font SIZE=2> $FORM{'keywords'}</td></tr>\n";
print "<tr><td align=right><FONT $font SIZE=2><B>Description :</B></font></td><td><FONT $font SIZE=2> $FORM{'description'}</td></tr>\n";
print "<tr><td align=right><FONT $font SIZE=2><B>E-mail :</B></font></td><td><FONT $font SIZE=2> $FORM{'email'}</font></td></tr></table></center><p>\n";
print "<INPUT TYPE=button name=send></FORM></CENTER>\n";
}
#######HERE I WOULD BREAK IT CREATING "SEND":#########
# (sub send)
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 "";
print MAIL "http";
print MAIL "---------------------------------------------\n";
close (MAIL);
}
&footer;
}