PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am developing a content management system, and I have some details stored in a mysql database. I am trying to retrieve an image whose path is stored in the database.
but the image is not showing. I would appreciate it if someone could point me in the right direction as I have been staring at this for the past 30 minutes without a clue..
the dot means the root and if you change your server name or something has changed then there would not be much problem.
Somebody correct me if i'm wrong
I tried your method, but just got an error stating that no such directory exists, as the dot does not seem to take it to the document root of the server.
I should think that since I have the image path stored as the complete path on the server it should show the image when I use it as a source, but do not understand why it is not working.
Well, I did try using the absolute URL to load the image, but that did not work so I take it that the setup of the server my website is not compatible with loading content via that path, so I developed a workaround.
I simply just extracted a substring of the full path that contains the end bit: /images/portfolio/myImage.jpg , and appended the starting URL to it. Its now working perfectly.