CGI-script doesn't work in Firefox
CGI-script doesn't work in Firefox
(OP)
Working with HTML, CGI and MySQL. My pages looks perfekt with IE, but when I open them with Firefox I just see my code. Eg http://www.grindange.com/os/toplist.cgi or http://www.grindange.com/os/guess.shtml
Any one who can explain why?
Any one who can explain why?
RE: CGI-script doesn't work in Firefox
RE: CGI-script doesn't work in Firefox
something like this:
CODE
-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
RE: CGI-script doesn't work in Firefox
RE: CGI-script doesn't work in Firefox
NCSA CGI Primer
The difference between Firefox and IE in this context is that, if the document doesn't specify it's content type, IE assumes text/html and Firefox simply shows you the document.
I feel that Firefox's approach in this case is more appropriate, but I'm not sure that either browser is breaking any rules.
CGI and Perl (even Embedded Perl) run on the server side. Neither Firefox or IE can run embedded Perl... but that was just a simple print command that is almost the same in most programming languages.
Try one of these:
CODE
system.out.println( "Content-Type: text-html\n" );
/* C */
printf( "Content-Type: text/html\n\n" );
/* PHP or Perl */
print( "Content-Type: text/html\n\n" );
# bash, bourne, or korn shell
echo "Content-Type: text/html\n\n";
The important part is that it has to be the first line of output.
In summary, I never like to make this the only response, but... RTFM
--
-- Ghodmode
RE: CGI-script doesn't work in Firefox
RE: CGI-script doesn't work in Firefox