HOW TO RE-DIRECT FROM CGI FILE TO HTML FILE
HOW TO RE-DIRECT FROM CGI FILE TO HTML FILE
(OP)
Hi everyone,
Currently i am doing a server side scripting of cgi.
I have an html page whose action on SUBMIT is directed to a .cgi page which re-directs back to another new html page based on the condition.
contents of test.cgi:
--------------------
print "Content-type: text/html\n\n";
print "Hello, world!\n";
Thnx in advance,
Vishnu
#print redirect("http://10.140.5.30:8080/Result/Report.htm");
#print "Location: 'http://10.140.5.30:8080/Result/Report.htm';
The "HELLO WORLD !" static text is printed but the re-direction command both "redirect" and "Location" failed to re-direct the page.
Currently i am doing a server side scripting of cgi.
I have an html page whose action on SUBMIT is directed to a .cgi page which re-directs back to another new html page based on the condition.
contents of test.cgi:
--------------------
print "Content-type: text/html\n\n";
print "Hello, world!\n";
Thnx in advance,
Vishnu
#print redirect("http://10.140.5.30:8080/Result/Report.htm");
#print "Location: 'http://10.140.5.30:8080/Result/Report.htm';
The "HELLO WORLD !" static text is printed but the re-direction command both "redirect" and "Location" failed to re-direct the page.
RE: HOW TO RE-DIRECT FROM CGI FILE TO HTML FILE
The Location is a HTTP header. So if you send content before it, that will not act as HTTP header anymore.
CODE
print "Location: http://10.140.5.30:8080/Result/Report.htm\n\n";
print "Hello, world!\n";
Feherke.
http://rootshell.be/~feherke/
RE: HOW TO RE-DIRECT FROM CGI FILE TO HTML FILE
RE: HOW TO RE-DIRECT FROM CGI FILE TO HTML FILE
Say in a cgi file: test.cgi
&upload;
&workonreport;
<redirection code should come here>
After executing the functions, the redirection should happen.
Vishnu
RE: HOW TO RE-DIRECT FROM CGI FILE TO HTML FILE
"Status: 302 Moved Location: http://10.140.5.30:8080/Result/Report.htm "
I dont see the Report.htm page.
Vishnu
RE: HOW TO RE-DIRECT FROM CGI FILE TO HTML FILE
Did you removed the second new line ( \n ) from the Content-type header line's output ?
Feherke.
http://rootshell.be/~feherke/
RE: HOW TO RE-DIRECT FROM CGI FILE TO HTML FILE
-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
RE: HOW TO RE-DIRECT FROM CGI FILE TO HTML FILE
If you want to see the Hello message before stepping forward, use the Refresh HTTP header :
CODE
print "Refresh: 3;url=http://10.140.5.30:8080/Result/Report.htm\n\n";
print "Hello, world!\n";
Feherke.
http://rootshell.be/~feherke/
RE: HOW TO RE-DIRECT FROM CGI FILE TO HTML FILE
Vishnu