Hi,

On Tue, 7 Aug 2001, Lee Hoffner wrote:

> use strict;
> use CGI qw/:standard/;
> my $dir = param('dir');
> 
> #Verify that the requested directory exists.
> #I imagine I want to say something like:
> if (-d $dir) {
> 
>  print <<END;
>  Content-Type: text/html\n\n
>  <html>
>  <body>
>  <table>
>  END

>  @filearray = opendir(D,$dir) or die $!;

Since you've already opened the HTML page, you would want a graceful die
procedure here, something like

dieNice {  # assume http headers sent already and html page has begun
        print "Sorry, this system is unavailable now.<P>"
        print "</BODY></HTML>";
        exit;
} 

I like to tell users that a system is unavailable rather than some not
found message.   Of course in this case, you'd want to send yourself a
message since you're passing the image directory to yourself, but a user
can change it.

Lastly, you could also pass the image directory as a PATH_INFO variable:

http://foo.com/script.pl/image_dir

$ENV{PATH_INFO} = "image_dir"  (I can't remember if / is included or not)


Lisa Wolfisch Nyman  <[EMAIL PROTECTED]>  IT Warrior Princess
"Life is too short to wear ugly underwear."
Get the facts at http://quickfacts.census.gov/




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

Reply via email to