I have a strange problem. I can not quite understand this problem and so need your help. I use a php function to retrieve the url of the user's profile picture. My function is as below, it is slightly modified but the concept is the same.
PHP Code:
<?php function profile_image($pid,$type)
{
if($type == 'thumb')
{
echo'http://imageurl.com';
}
else
{
echo'http://imageurl.com';
}
}
?>
When I extract the image with one of the 2 that follow depending on exactly where I am:
PHP Code:
<img src="<?php profile_image($userid,'thumb'); ?>">
echo'<img src="'.profile_image($userid,'thumb').'">';
The thing is that it this works when I use the top of the two, but when I use the bottom it is going outside imageurl <img-tag>.
Result with the top:
HTML Code:
<img src="http://imageurl.com">
Result with the bottom:
HTML Code:
http://imageurl.com<img src="">
Is there something I do very wrong here? I'm not sure what it could be. I have only basic knowledge about php, so it may be it is just a small file error that I do not know about?
Bookmarks