-------------------------------------------------------------------
-->> FREE Perl CGI scripts add WEB ACCESS to your POP email accounts!
-->> Download today!! http://www.adjeweb.com
-------------------------------------------------------------------
I have the following perl script which I'm currently using
successfully. What I want to do is add a background image to the
html page when it comes up, but it's not showing. Can Someone tell
me what the problem is? I put the reference to the background image
in the
# START HTML DOCUMENT section.
Admin
--------------------------------------------------------------------
#!/usr/bin/perl -w
use 5.004;
use strict;
use CGI qw(:standard);
use Fcntl qw(:flock);
# ERROR SUBROUTINE
sub bail {
my $error = "@_";
print h1("Unexpected Error"), p($error), end_html;
die $error;
}
# LOCAL/PRIVATE STRINGS AND ARRAYS
my(
$WALL,
$CHATNAME,
$MAXSAVE,
$TITLE,
$HOME,
$cur,
@entries,
$entry,
);
$TITLE = "Hosting Ohio Chat Server, version 1.1";
$HOME = "<a href=http://www.hostingohio.com>[main page]</a>";
$CHATNAME = "/home/admin/hostingohio-www/chat/chatfile2";
$WALL = "/home/admin/hostingohio-www/balloons.jpg";
$MAXSAVE = 100;
# START HTML DOCUMENT
print header, start_html(-title=>"$TITLE", -background=>"$WALL"),
h2($TITLE), ($HOME);
$cur = CGI->new();
if ($cur->param("message")) {
$cur->param("date", scalar localtime);
@entries = ($cur);
}
# CHATFILE LOCK PROCEDURE
open(CHANDLE, " < $CHATNAME") || bail("cannot open $CHATNAME: $!");
flock(CHANDLE, LOCK_EX) || bail("cannot flock $CHATNAME: $!");
while (!eof(CHANDLE) && @entries < $MAXSAVE) {
$entry = CGI->new(\*CHANDLE);
push @entries, $entry;
}
seek(CHANDLE, 0, 0) || bail("cannot rewind $CHATNAME: $!");
foreach $entry (@entries) {
$entry->save(\*CHANDLE);
}
truncate(CHANDLE, tell(CHANDLE)) || bail("cannot truncate $CHATNAME:
$!");
close(CHANDLE) || bail("cannot close $CHATNAME: $!");
# FORM DATA
print hr, start_form;
print p("Nick:", $cur->textfield(-NAME => "name"));
print p("Say:", $cur->textarea(-NAME => "message", -OVERRIDE => 1,
-ROWS => 5, -COLUMNS => 50));
print p(submit("Send/Refresh"), reset("Start Over"));
print end_form, hr;
# PRINTED CHAT HISTORY
print h3("Last Said:");
foreach $entry (@entries) {
printf("%s [%s]", $entry->param("date"), $entry->param("name"));
print p();
printf("%s", $entry->param("message"));
print p();
print hr;
}
print end_html;
[EMAIL PROTECTED]
www.hostingohio.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]