About CGI...

Started by benthehutt, September 23, 2005, 05:30:00 PM

Previous topic - Next topic
So I'm new to the whole Perl thing and CGI in the first place, and I'm having problems when requesting info from a perl script.  This is what's up:

I've got a swf file (flash) and I want it to talk to a perl script on the server.  So then, I've got the flash end good I think--though I haven't gotten the other end to work so I can't be too sure.  Anyway, the swf has a function called loadVariableNum that will connect to a script on a server and take whatever the script returns.  So, I just did this:

_root.lastModified = loadVariablesNum("lastUpdate.pl", 0, "POST");

where _root.lastModified is just where I'm storing it in flash.

That I think should work.

The file "lastUpdate.pl" goes like this:

Code  perl Select
#!d:/perl/bin

print "Content-type: text/html\n\n" ;

@URL = (flastmod, "monitoring.html");

print exec(@URL);


Theoretically this should return the date and time the page was last modified, but even if I just run the script from explorer it just prints "0."  I even tryed using system (which I belive is the one I should use--cause exec doesn't return anything) and rearranged stuff like this:

Code  perl Select
#!d:/perl/bin

print "Content-type: text/html\n\n" ;

print system(flastmod "monitoring.html");


Nothing freaking works!  What's the deal with this?  I know I have permissions and everthing, cause I wrote this to see if the Perl script could work on the server:

Code  perl Select
#!d:\perl\bin


print "Content-type: text/html\n\n";
print "\n";

foreach $key (sort keys(%ENV)) \
   { print "$key = $ENV($key) <br>";
   }


And it printsout all the environmental variables.  Does anyone know why the script would only print "0" ?
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.

So, here's why I'm an idiot: the exec command (and system) can't excecute flastmod--that's just an SSI thing.  So then, instead of going though all that crap I just put a SSI at the bottom of the page like this:

<!--#flastmod file="theFile.html" -->

and that (as you know) just puts the date on the bottom of the page.

I also found out that flash can't put much HTML in it's text boxes.  It only supports about ten tags, like <head>, <html>, <b>, <i>, etc.  So don't try to put a SSI in a flash text box! (since none of you use flash, no one cares anyway...)

BTW, does anyone know of any open source flash compiler projects?  It seems like it should be possible, just incredibly difficult to do...
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.

SMF spam blocked by CleanTalk