Sigrid Kelsey wrote:
: I would like an alert to pop up everytime someone accesses a certain cgi
: script (I'm new at this).  I have commented out my lame attempts that don't
: work below, but I think they will show what I'm trying to do.
: 
: #! /usr/sbin/perl
: 
: #print "<SCRIPT LANGUAGE='JavaScript'>
: #       alert('MESSAGE');</script>";
: 
: if (($ENV{"REMOTE_ADDR"} =~  123.321.321.321) &&
:     (!($ENV{"REMOTE_ADDR"} =~ /^123\.123\.123\.132))) {
: # alert("MESSAGE");
:         print "Location:        blahblah.html\n\n";
: } else {
:         print "Location:        blahblahblah.html\n\n";
: }

You can have Perl print the Javascript command that causes a popup:

if ($ENV{REMOTE_ADDR} eq '123.321.321.321' ) {
        print "<body onLoad=\"alert('MESSAGE')\">\n";
} else {
        print "<body>\n";
}

-- tdk

Reply via email to