Reference to Files
-
I have been writing my first CGI program, but have problems loading images and background files. Both the Server and Browser are on the same PC. I needed to write:-
cout << ""
to get the images loaded. i.e. the following line did not work:-cout << ""
I tried this and it did not workcout << "";
Later in the program when I tried this the image was not displayed (little box with red cross - image not found) Also tried a different image as follows, did not load.cout << "";
grahamfff -
I have been writing my first CGI program, but have problems loading images and background files. Both the Server and Browser are on the same PC. I needed to write:-
cout << ""
to get the images loaded. i.e. the following line did not work:-cout << ""
I tried this and it did not workcout << "";
Later in the program when I tried this the image was not displayed (little box with red cross - image not found) Also tried a different image as follows, did not load.cout << "";
grahamfffYou have to reference the images (and any other resources) in terms of the web path. Forget the fact that you are on a filesystem. As far as the web server is concerned you are on a virtual filesystem. So: img src='http://localhost/maybe-sub-dir/image-name.jpg' if you get my meaning :)