----- Original Message -----
From: "Mario R. Sanchez, Ph.D." <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, June 12, 2006 2:53 AM
Subject: javascript invokes .pl but no cgi output
dear gurus
i have the following script pl.pl (yes, ugly but it works...)
-------------------
#!/usr/bin/perl
#pl.pl
use CGI;
$cgi = new CGI;
###adds 1 to the counter
open(COUNT,"count.txt") || die "Can't open count data file for Reading:
$!\n";
$c = <COUNT>;
close(COUNT);
if ($count =~ /\n$/) {
chop($c);
}
$c++;
open(COUNT,">count.txt") || die "Can't open count data file for
Writing: $!\n";
print COUNT "$c";
close(COUNT);
###displays graphic numbers
print "Content-type:text/html\n\n";
print "<html><head><title>COUNTERING OF JS.PL</title></head><body>\n";
print "ALO\n";
print qq(<img border="0" src="0.gif" width="36" height="40"><img
border="0" src="7.gif" width="36" height="40"><img border="0" src="6.gif"
width="36" height="40">);
print "</body></html>\n";
exit;
--------------------
this script works as i want it to - the counter adds and the graphics
display. verify if you like at;
http://www.dbiq.com/cgi-bin/mi/pl.pl
ok. so i want to call it this way (no, i cant use inline frame, or the
<img> thing or ssi)
<html>
<head>
</head>
<body>
hi
<div><SCRIPT LANGUAGE="Javascript"
SRC="http://www.dbiq.com/cgi-bin/mi/pl.pl"></SCRIPT></div>
</body>
</html>
the script actually executes - confirmed because 1 is added to count.txt
BUT ... the graphics are never sent back. in fact, even regular text is
not sent back to the browser. i've tried changing the Content-type to
This can not work :-) Javascript is script that run on client side, but perl
(cgi) script run on server side. But this can work if you use <iframe> like
this
<html><head></head>
<body>
hi
<div><iframe width=50 height=50 frameborder=0
SRC="http://www.dbiq.com/cgi-bin/mi/pl.pl"></iframe></div>
</body></html>
Petr Vileta, Czech republic
(My server reject all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs