Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
CGI / PHP Help Again
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- CGI / PHP Help Again
CGI / PHP Help Again
20-03-2008 3:44 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
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" ??

Message 1 of 3
(952 Views)
2 REPLIES 2
Re: CGI / PHP Help Again
20-03-2008 5:16 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
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
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
Message 2 of 3
(195 Views)
Re: CGI / PHP Help Again
26-03-2008 6:07 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
"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,
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,
Message 3 of 3
(195 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page