homepage Welcome to WebmasterWorld Guest from 54.234.225.23
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
Perl Script Problem (I'm too blind to see the error!)
Froggyman




msg:430465
 5:31 am on Feb 27, 2001 (gmt 0)

OK, I give up! I am writing a BBS script and everything else is working fine with one exception where I keep recieving a DNS error. I have isolated the error somewhere in the following code. All variables are correct:

print NEWFILE "<form method=POST action=\"$cgi_url\">\n";

if ($email_reply) {
print NEWFILE "<input type=hidden name=\"email_reply\" value=\"reply\">\n";
}

print NEWFILE "<input type=hidden name=\"followup\" value=\"";

if ($followup == 1) {
foreach $followup_num (@followup_num) {
print NEWFILE "$followup_num,";
}
}
print NEWFILE "$num\">\n";
print NEWFILE "<input type=hidden name=\"origname\" value=\"$name\">\n";
if ($email) {
print NEWFILE "<input type=hidden name=\"origemail\" value=\"$email\">\n";
}
print NEWFILE "<input type=hidden name=\"origsubject\" value=\"$subject\">\n";
print NEWFILE "<input type=hidden name=\"origdate\" value=\"$long_date\">\n";
print NEWFILE "<center><table width=100% border=\"0\">\n";
print NEWFILE "<tr><td align=\"right\"><font face=\"Arial, sans-serif\"><font size=2><font color=\"#000000\">Name:</font></font></font></td>\n";
print NEWFILE "<td><input type=text name=\"name\" size=40></td>\n";
print NEWFILE "</tr><tr>\n";
print NEWFILE "<td align=\"right\"><font face=\"Arial, sans-serif\"><font size=2><font color=\"#000000\">E-Mail:</font></font></font></td>\n";
print NEWFILE "<td><input type=text name=\"email\" size=40></td>\n";
print NEWFILE "</tr><tr>\n";
if ($subject_line == 1) {
if ($subject_line =~ /^/) {
print NEWFILE "<input type=hidden name=\"subject\" value=\"$subject\">\n";
print NEWFILE "<td align=\"right\"><font face=\"Arial, sans-serif\"><font size=2><font color=\"#000000\">Subject: $subject</font></font></font></td>\n";
}
else {
print NEWFILE "<input type=hidden name=\"subject\" value=\"$subject\">\n";
print NEWFILE "<td align=\"right\"><font face=\"Arial, sans-serif\"><font size=2><font color=\"#000000\">Subject: $subject</font></font></font></td>\n";
}
}
elsif ($subject_line == 2) {
print NEWFILE "<td align=\"right\"><font face=\"Arial, sans-serif\"><font size=2><font color=\"#000000\">Subject:</font></font></font></td>\n";
print NEWFILE "<td><input type=text name=\"subject\" size=50></td>\n";
}
else {
if ($subject =~ /^/) {
print NEWFILE "<td align=\"right\"><font face=\"Arial, sans-serif\"><font size=2><font color=\"#000000\">Subject:</font></font></font></td>\n";
print NEWFILE "<td><input type=text name=\"subject\" value=\"$subject\" size=50></td>\n";
else {
print NEWFILE "<td align=\"right\"><font face=\"Arial, sans-serif\"><font size=2><font color=\"#000000\">Subject:</font></font></font></td>\n";
print NEWFILE "<td><input type=text name=\"subject\" value=\"$subject\" size=50></td>\n";
}
}
print NEWFILE "</tr><tr>\n";
print NEWFILE "<td align=\"right\"><font face=\"Arial, sans-serif\"><font size=2><font color=\"#000000\">Comments</font></font></font></td>\n";
print NEWFILE "<td><textarea name=\"body\" COLS=58 ROWS=10 wrap=physical>\n";
if ($quote_text == 1) {
@chunks_of_body = split(/\<\;p\>\;/,$hidden_body);
foreach $chunk_of_body (@chunks_of_body) {
@lines_of_body = split(/\<\;br\>\;/,$chunk_of_body);
foreach $line_of_body (@lines_of_body) {
print NEWFILE ": $line_of_body\n";
}
print NEWFILE "\n";
}
}
print NEWFILE "</textarea></td>\n";
print NEWFILE "</tr><tr>\n";
print NEWFILE "<td align=\"right\"><font face=\"Arial, sans-serif\"><font size=2><font color=\"#000000\">Optional Link URL:</font></font></font></td>\n";
print NEWFILE "<td><input type=text name=\"url\" size=50></td>\n";
print NEWFILE "</tr><tr>\n";
print NEWFILE "<td align=\"right\"><font face=\"Arial, sans-serif\"><font size=2><font color=\"#000000\">Link Title:</font></font></font></td>\n";
print NEWFILE "<td><input type=text name=\"url_title\" size=50></td>\n";
print NEWFILE "</tr><tr>\n";
print NEWFILE "<td align=\"right\"><font face=\"Arial, sans-serif\"><font size=2><font color=\"#000000\">Optional Image URL:</font></font></font></td>\n";
print NEWFILE "<td><input type=text name=\"img\" size=50></td>\n";
print NEWFILE "</tr><tr>\n";
print NEWFILE "<td><br></td>\n";
print NEWFILE "<td><input type=submit value=\"Submit Follow Up\" style=\"color: #000080; font-family: 'Arial', sans-serif; font-size: 10pt\"><input type=reset style=\"color: #000080; font-family: 'Arial', sans-serif; font-size: 10pt\"></td>\n";
print NEWFILE "</tr><tr>\n";
print NEWFILE "</table></center></form>\n";

Thank you!

 

Air




msg:430466
 7:19 am on Feb 27, 2001 (gmt 0)

if ($subject =~ /^/) {
print NEWFILE "<td align=\"right\"><font face=\"Arial, sans-serif\"><font size=2><font color=\"#000000\">Subject:</font></font></font></td>\n";
print NEWFILE "<td><input type=text name=\"subject\" value=\"$subject\" size=50></td>\n";
else {
print NEWFILE "<td align=\"right\"><font face=\"Arial, sans-serif\"><font size=2><font color=\"#000000\">Subject:</font></font></font></td>\n";

Notice the else without the ending } to end the if

You'll probably find you're one closing } short once you add the one preceding the else but I got tired of counting to see where it goes.

Froggyman




msg:430467
 8:05 am on Feb 27, 2001 (gmt 0)

THANK YOU! That was it and the script is working great now. I knew it was something simple :) That's Perl for you...

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved