need help in getting background images to show up in a cgi script

2001-10-18 Thread [EMAIL PROTECTED]


---
-- 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]




Re: need help in getting background images to show up in a cgi script

2001-10-18 Thread Casey West

On Oct 18, 2001 at 04:14 -0400, [EMAIL PROTECTED] took the soap box and proclaimed:
: 
: ---
: -- 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.

You seem to have that part right.  Using the CGI module, if I

  print start_html( -background = foo.jpg );

it prints

  ?xml version=1.0 encoding=utf-8?
  !DOCTYPE html
  PUBLIC -//W3C//DTD XHTML Basic 1.0//EN
  http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd;
  html xmlns=http://www.w3.org/1999/xhtml; lang=en-USheadtitleUntitled 
Document/title
  /headbody background=foo.jpg

I would venture a guess that the image you want to show isn't in the
location your script thinks it is.

Make sure the file that the value of $WALL refers to actually exists,
also check that permissions on that file are OK.


: # START HTML DOCUMENT
: print header, start_html(-title=$TITLE, -background=$WALL),
: h2($TITLE), ($HOME);

  Casey West

-- 
Shooting yourself in the foot with Smalltalk 
You send the message shoot to gun, with selectors bullet and myFoot. A
window pops up saying Gunpowder doesNotUnderstand: spark. After
several fruitless hours spent browsing the methods for Trigger,
FiringPin and IdealGas, you take the easy way out and create ShotFoot,
a subclass of Foot with an additional instance variable bulletHole. 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: need help in getting background images to show up in a cgi script

2001-10-18 Thread RaFaL Pocztarski

[EMAIL PROTECTED] wrote:

 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.

 $WALL = /home/admin/hostingohio-www/balloons.jpg;

 print header, start_html(-title=$TITLE, -background=$WALL),

It's not a Perl but HTML question. When a browser gets

  body background=/home/admin/hostingohio-www/balloons.jpg

it will try to download
http://www.hostingohio.com/home/admin/hostingohio-www/balloons.jpg
not
http://www.hostingohio.com/balloons.jpg

- RaFaL Pocztarski, [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]