Click to See Complete Forum and Search --> : Opening CGI Script in Browsers
fobia
12-13-2003, 07:10 AM
Hi,
I'm having a problem with a guestbook CGI script that I call in a frame (by setting inital page displayed to eg www.mysite.com/cgi-bin/guestbook.cgi).
Some users (including me) can access this fine, others are asked whether they want to open or save the file www.mysite.com/cgi-bin/guestbook.cgi. I assume this is due to a setting on the individual's browser, but is there any way to force the browser to open the script in the specified frame?
Any help would be appreciated,
Thanks.
:confused: :confused: :confused:
Jeff Mott
12-13-2003, 12:06 PM
Can you provide a link to the page?
fobia
12-13-2003, 07:37 PM
Sure - the script I'm trying to call is:
http://www.silentsoundz.co.uk/cgi-bin/firebook2/firebook.cgi
This should open in the guestbook link @ http://www.silentsoundz.co.uk
Cheers.
:)
Jeff Mott
12-13-2003, 08:10 PM
I was also prompted with a download dialog. It looks like your CGI script is spitting out random (or possibly encrypted) data. But without seeing the script's code I have no way of knowing why or how to fix it.
An unrelated FYI: background music on a site is irritating to users more often than not. I was perfectly content listening to my own music when yours got mixed in. And when that happens, on any site, I have the option of turning off my music that I'm happily listening to or closing out of the site... guess which one I usually choose.
ray326
12-13-2003, 10:53 PM
Here are the headers coming out of that CGI.
HTTP/1.x 200 OK
Date: Sun, 14 Dec 2003 03:46:03 GMT
Server: Apache/1.3.29 (Unix)
gzip: Content-Encoding
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=ISO-8859-1
I've never seen a gzip header before and sometimes the Content-type is text/plain. At any rate, it has nothing to do with the browsers.
Jeff Mott
12-13-2003, 11:41 PM
Based on ray326's information, I saved and uncompressed the data. It is indeed a gzip file, and its contents is a single file containing the HTML markup that is supposed to be returned to the browser. The problem is that this linegzip: Content-Encodingis backwards. It should readContent-Encoding: gzipThat is, if browsers are able to correctly interpret that and read the compressed contents. If they can then keep doin it (with the corrected header of course). If they can't then you'll have to remove the whole gziping process from the CGI script completely.
ray326
12-14-2003, 01:32 AM
Doh! Way to go, Jeff. I should have seen that simple reversal. This is the first time I've seen something try to gzip encode a reply. I hope he gets it fixed so we can see whether it really works. 8-)
fobia
12-14-2003, 05:11 AM
Cheers guys - the gzip compression function is a (recommended) option in the guestbook admin section, so I should just be able to turn that off - guess it won't make too much difference.
About the music - I agree it is annoying, and it is something we will be looking at, but I do what the boss tells me! Hopefully the intro music will eventually accompany an animation with the option of music on/off (the site is still very much in development).
Thanks again for your help, I'll give it a try now.
:)
fobia
12-14-2003, 05:21 AM
OK, I've turned off gzip compression in the admin centre - I've asked my mate to test it so we'll wait and see..........