in reply to Inserting CGI code in script tag
I agree with both Arguile and Boldra in that your question is slightly confusing.
It appears that what you are trying to do is to redirect to another CGI script ('test.cgi') from your script, of which you've presented a fragment. To do this using CGI.pm, you merely have to:
print $q->redirect($refreshUrl);
This sends an HTTP header which has the same effect as putting the following line into the header of an HTML page (hence the name, "HTTP-EQUIV"):
<META HTTP-EQUIV="Refresh" CONTENT="$refreshTime; URL=$refreshUrl">
Your script fragment does precisely the same thing in its last line (which prints the Location: header). In fact, you could get rid of all the other print statements to the same effect.
What's confusing is the relationship between $refreshFile and $refreshUrl. If you meant $refreshUrl to refer to the same file, the one you are creating on the fly, your file would be redirecting to itself in an endless loop.
BTW, the URL in the <SCRIPT> tag (src='http://www.test.com/cgi-bin/test.cgi') should refer to a javascript file, e.g., 'something.js', NOT to a perl script (unless that perl script is a CGI program that writes pure javascript code to its standard output).
Any code between the <SCRIPT> and </SCRIPT> tags ought to be javascript as well.
In either case, the javascript code executes at the BROWSER, not on the server.
dmm
You can give a man a fish and feed him for a day ... Or, you can teach him to fish and feed him for a lifetime
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Inserting CGI code in script tag
by Anonymous Monk on Oct 24, 2001 at 02:06 UTC | |
by dmmiller2k (Chaplain) on Oct 24, 2001 at 21:42 UTC |