CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Problems with HTML rendered through a perl script.


New User

Aug 3, 2003, 8:24 PM

Post #1 of 1 (330 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:

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='$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, feel free to register and look at it.

(This post was edited by scott_jcp on Aug 3, 2003, 8:25 PM)


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives