The cool thing about forums is that you have 3426 different ways to store stuff depending on what you want you're forum to do... The basic design of your forum is correct, but you might want to consider opening new files for each of the comments posted. Ie:
# put all posts in ./msgs
open(WRITE,">msgs/$^T.txt") or die();
print WRITE "<P>",$query->param('name');
print WRITE "<P>",$query->param('subject');
print WRITE "<P>",$query->param('message');
close(WRITE);
# ...
# and later when you're making up the page...
# sort the messages by date
foreach $msg (sort glob('msgs/*.txt')) {
open(READ,$msg) or warn($!);
@msg = <READ>;
close(READ);
print FORUM "@msg\n";
}
By doing this, you can later on make is so that each one of you're posters can re-edit his own post, generate stats,
clean-up old messages and other cool things of the sort...
Forums were the way that I learned perl in the 1st place. Forums are fun!
#!/home/bbq/bin/perl
# Trust no1!
In reply to Re: Help!
by BBQ
in thread Help!
by Anonymous Monk
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.