just want a picture!
Posted: Fri Jan 16, 2009 8:29 pm
I am learning first off.. I have been having trouble trying to get this to function without help. Here is my issue:
I have an image's path info located in an a database. I want to display this image on the website.
Problem #1 - file is in format C:\images\sub-directory\photo.jpg
Solution #1 - $fixed_path = str_replace('\\', '/', $image_path);
This gives me - c:/images/subdirectory/photo.jpg. Fine.
So I echo this to the website inside of <img> tags to be viewed and nothing.. due to the fact that the file isn't under the htdocs directory I'm sure. Even when the images are placed in a sub-directory of htdocs I still have the full path of the image to work with which also results in no image displayed.
What I am attempting is to use the web browser to parse a directory full of images on my HD, add path and image information to a database then display each image. A learning endeavor, no real world use.
Is there a better way to skin this cat?
I have an image's path info located in an a database. I want to display this image on the website.
Problem #1 - file is in format C:\images\sub-directory\photo.jpg
Solution #1 - $fixed_path = str_replace('\\', '/', $image_path);
This gives me - c:/images/subdirectory/photo.jpg. Fine.
So I echo this to the website inside of <img> tags to be viewed and nothing.. due to the fact that the file isn't under the htdocs directory I'm sure. Even when the images are placed in a sub-directory of htdocs I still have the full path of the image to work with which also results in no image displayed.
What I am attempting is to use the web browser to parse a directory full of images on my HD, add path and image information to a database then display each image. A learning endeavor, no real world use.
Is there a better way to skin this cat?