Re: Python CGI & Webpage with an Image

2008-03-08 Thread rodmc
> Is the cgi script in the same directory? The user's browser looks > for the jpg relative to the URL it used to get the page, which in > the case of the CGI script is the path to the script, not the > path to the html file. No the CGI script is in a different folder, I could move everything to

Re: Python CGI & Webpage with an Image

2008-03-06 Thread Bryan Olson
rodmc wrote: > [...] I have played around a bit more > so that both the image and HTML file are in the public_html folder. > They are called via python using a relative URL, and have permissions > set to 755. Within the HTML file the image is accessed using just > "banner.jpg". The actual page disp

Re: Python CGI & Webpage with an Image

2008-03-06 Thread rodmc
Hi, Thanks for your very quick response. I have played around a bit more so that both the image and HTML file are in the public_html folder. They are called via python using a relative URL, and have permissions set to 755. Within the HTML file the image is accessed using just "banner.jpg". The act

Re: Python CGI & Webpage with an Image

2008-03-06 Thread Bryan Olson
rodmc wrote: [...] > Python: > > f = open("finish.html") > doc = f.read() > f.close() > print doc You might need to start with: print "Content-Type: text/html" print Is "finish.html" in the right place? When you browse to your script, can you see that you're getti

Re: Python CGI & Webpage with an Image

2008-03-06 Thread rodmc
Hi, Good point, some code samples is probably required. Please note that for reasons of integration with another system I am not using a templating system. Anyway I have copied them below: Python: f = open("finish.html") doc = f.read() f.close() print doc HTML:

Re: Python CGI & Webpage with an Image

2008-03-05 Thread Miki
Hello Rod, > I have a set of CGI scripts set up and in one page (which is stored in > an HTML file then printed via a python CGI) there is an image. However > the image never displays, can anyone recommend a way round this > problem? We need more information, can you post a code snippet? error pag