petroz Posted January 24, 2010 Share Posted January 24, 2010 Hi Guys, I am trying to echo the path to a img from a db. When my $thumb var is called it shows up with a valid url. When I compose the img src tag and echo $thumb I am getting a really weird looking url. The url's are showing up like the below; http://mysite.local/wp-content/uploads/%3C/span%3E2009/09/yuriandgrouper.jpg%3Cspan%20style= <img src="<?php echo $thumb;?>" height="50" width="50" border="0"/> any help would be greatly appreciated. Thanks! Link to comment https://forums.phpfreaks.com/topic/189613-echo-img-src-showing/ Share on other sites More sharing options...
Fergal Andrews Posted January 24, 2010 Share Posted January 24, 2010 What you are seeing is an encoded URL. Use urldecode() to echo the URL in it's human readable form. <?php $url = 'http://mysite.local/wp-content/uploads/%3C/span%3E2009/09/yuriandgrouper.jpg%3Cspan%20style= '; echo urldecode($url); ?> Will display: http://mysite.local/wp-content/uploads/2009/09/yuriandgrouper.jpg Link to comment https://forums.phpfreaks.com/topic/189613-echo-img-src-showing/#findComment-1000765 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.