cancel
Showing results for 
Search instead for 
Did you mean: 

CGI / PHP Help Again

ChrissyD
Dabbler
Posts: 13
Registered: ‎06-08-2007

CGI / PHP Help Again

Ok, So I`ve got a .php script uploaded to my cgi-bin,  but all my images (jpegs) are missing.  I understand that the cgi-bin isn`t the right place to put jpegs.  How do I get the images to appear.  Do I need to change my 'image src' code to incorporate an address ie. 'image src="http://*******.co.uk/image1.jpg" ??    Shocked
2 REPLIES 2
Peter_Vaughan
Community Veteran
Posts: 14,469
Registered: ‎30-07-2007

Re: CGI / PHP Help Again

cgi-bin is not the correct place for .php files either as they will not run there.
Unless you mean't ccgi, the name of the server?
You need to refer to your images via relative addressing - i.e. in relation to where your php file is.
So if you have a folder called images containing your images, and have your php file in your root folder, you just refer to them as images/file.jpg.
If your php file is in a folder called website, then you would use ../images/file.jpg

Prod_Man
Grafter
Posts: 286
Registered: ‎04-08-2007

Re: CGI / PHP Help Again

"cgi-bin is not the correct place for .php files either as they will not run there."
I know of a PHP file (that I use regularly) that says different in my cgi-bin directory,
but, hey .. moving on.
In response;
I would create a directory in the root of your webspace,
call it "images" or "img".
http://xxx.site.ext/images
http://xxx.site.ext/img
Then yes as Peter has outlined, use the correct paths.
Either use entirely full paths (http://xxx.site.ext/images/image.ext) direct locations to the images...
or make sure your relative paths are correct for the page location (again as Peter outlined).
Page Location: http://xxx.site.ext/documentation/
means the location of image.ext relative to /documentation is ../images/
../images/image.ext
../ = How many times you have to go back a directory to get to the desired location of your images directory.
It just depends how your site is structured.
Jim,