definewebsites Posted May 2, 2008 Share Posted May 2, 2008 Hi there, 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. I obtained the path using the following: $uploadDir = $_SERVER['DOCUMENT_ROOT'] . "/images/portfolio/"; and after retrieving the details from the database, I am trying to display it using the below as part of a table: echo "<td rowspan=\"3\"><img src=\" ".$content . "\"/></td>"; 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.. Thanks Link to comment https://forums.phpfreaks.com/topic/103812-whats-wrong-with-this-code/ Share on other sites More sharing options...
ucffool Posted May 2, 2008 Share Posted May 2, 2008 What does the HTML source of your ECHO show? Link to comment https://forums.phpfreaks.com/topic/103812-whats-wrong-with-this-code/#findComment-531471 Share on other sites More sharing options...
dezkit Posted May 2, 2008 Share Posted May 2, 2008 echo "<td rowspan='3'><img src=' "; echo $content; echo "'/></td>"; ??? Link to comment https://forums.phpfreaks.com/topic/103812-whats-wrong-with-this-code/#findComment-531474 Share on other sites More sharing options...
benphp Posted May 2, 2008 Share Posted May 2, 2008 I don't think you want to use DOCUMENT_ROOT. That will return the local path. I assume you want the path to the images to be accessible to people on the Internet, which this won't be. Do you want the result to be http://mysite.com/images or c:\inetpub\wwwroot\images (windows) or /www/mysite/images (unix)? There's a way to get the path, but I can't think of it right now. Link to comment https://forums.phpfreaks.com/topic/103812-whats-wrong-with-this-code/#findComment-531506 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.