
scott_jcp
New User
Aug 3, 2003, 8:24 PM
Post #1 of 1
(307 views)
|
Problems with HTML rendered through a perl script.
|
Can't Post
|
|
I am using perl to code my own message board, but I am having a great deal of trouble getting any sort of style considerations to render when the page is viewed. For instance, this is the part of my site that shows a thread:
#!/usr/bin/perl use CGI':standard'; open (HEADER, "<data/header.dat"); @header = <HEADER>; close (HEADER); open (FOOTER, "<data/footer.dat"); $footer = <FOOTER>; close (FOOTER); $number = param('post'); ($thread,$ext) = split(/\./,$number); print "Content-type: text/html\n\n"; print "@header"; print "<a href='reply.pl?thread=$thread'>Click here to reply to this thread.</a><span class='blah'>BLAH!</span><br>"; print "<table width=75% border=0>"; opendir (POSTS, "data/posts"); while (defined($file = readdir POSTS)) { if ($file =~ m/thread$thread/) { open (FILE, "<data/posts/$file"); @post = <FILE>; close (FILE); $subject = $post[1]; $datetime = $post[2]; $poster = $post[3]; $message = $post[4]; $number = $file; $number =~ s/.post//; print "<tr bgcolor='darkslateblue'><td width=100><font color='white'>$poster</font></td><td><font color='white'>$subject</font></td></tr>"; print "<tr bgcolor='slategreen'><td>$datetime</td><td>$message</td></tr>"; } } closedir (POSTS); print "</table>"; print "<br>"; print "$footer"; Header and footer just contain links and a logo type thing for the top that are common to all pages. The loop works correctly, but apart from the bgcolor tags and font color tags, nothing works, I cannot set table width or anything. I have tried many different tags, and the only ones i can get to work are these, and only in their current position. I also tried a linked stylesheet, but it had no effect. The BBS is at http://12.207.53.187/cgi-bin/pbbs/main.pl, feel free to register and look at it.
(This post was edited by scott_jcp on Aug 3, 2003, 8:25 PM)
|