Hi - I am trying to set up a discussion board and am having problems. I have an html file call bbentry.html which allows the user to enter name, email and comments. It calls a script bb.pl and then this writes to bb.html. I have included the whole script (sorry if it is too much info) I get an error message that it can not find the temporary file but I am not sure what is wrong. Then if I run it again, I get Discussion Board in use. Please try again later. Can you help?? Thank you in advance. Alice
#!c:\perl\bin\perl.exe # ensure all fatals go to browser during debugging and set-up use CGI::Carp 'fatalsToBrowser'; require "c:\\webserver\\osarr.org\\www\\cgi-bin\\cgi-lib.pl"; &ReadParse; print &PrintHeader; $url="http://www.osarr.org/member/bboard/bb.html"; $bbfile="c:\\webserver\\osarr.org\\www\\member\\bboard\\bb.html"; unless (-e $bbfile) { print <<"PrintTag"; <html><body> <p>$bbfile is not found- something is wrong</p> </body></html> $tempfile="c:\\webserver\\osarr.org\\www\\member\\bboard\\bb.html"; if (($in{'name'} eq "") || ($in{'email'} eq "") || ($in{'comments'} eq "")) { print <<"PrintTag"; <html><body> Please complete all fields before submitting your message to the OSARR + Discussion Board. <br><br>Please complete:<br> PrintTag if ($in{'name'} eq "") { print "\n Your Name\n"; } if ($in{'email'} eq "") { print "\n Your Email Address\n"; } if ($in{'comments'} eq "") { print "\n Your Comments\n"; } print "</body></html>\n"; exit(0); } if (-e "glock.fil") { print <<"PrintTag"; <html><body> The OSARR Discussion Board is in use. Please try again later. </body></html> PrintTag exit(0); } open(LOCKFILE, ">glock.fil"); open(BBFILE,"$bbfile") ||die "Can't find the discussion board.\n"; @indata=<BBFILE>; close(BBFILE); open(TEMPFILE,">$tempfile") || die "Can't find this temporary file wha +t is wrong. \n"; foreach $i (@indata) { chomp($i); #copy line to temp file print TEMPFILE "$i\n"; #insert new form data below placeholder if ($i =~ /<!--BEGINNING-->/i) { print TEMPFILE "<p><a href=\"mailto:$in{'email'}\">"; print TEMPFILE "$in{'name'}"; print TEMPFILE "</a>"; print TEMPFILE "<br>"; print TEMPFILE "$in{'comments'}</p><hr>\n\n"; } } close (TEMPFILE); rename("$bbfile", "$bbfile.old"); rename("$tempfile", "$bbfile"); #close and unlink lock.fil close (LOCKFILE); unlink("glock.fil"); print <<"PrintTag"; <html><body> Your entry has been posted to the OSARR Discussion Board<Br><br> View <a href="$url">OSARR Discussion Board</a> </body></html> PrintTag #endprogram

In reply to Having trouble with a Discussion Board by Ineedhelpplease

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.