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 Quote 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? Quote 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>"; ??? Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.