Page 1 of 1

Image not displaying in PHP script

Posted: Fri Aug 12, 2011 8:03 pm
by spec36
Hi Guys,

I have the following link to an image that does not display when I point a <IMG SRC tag to it.

Note: The $BOB is not a variable in my script, but it is a code that is needed in the link to specify what chart to show.

Code: Select all

<?php code here
?>
<html>
<img src="http://website.com/c-sc/sc?r=658974&chart=$BOB:MM.TT,uu[305,a]dacayaci[pb20!b50][dd]">
</html
<?php more code here
?>
For some reason html is unable to read the above as a link and display the image. The link was taken from the address bar for the webpage that displays the image/chart properly. If I copy the link and paste it into firefox it loads the chart correctly. For some reason HTML is not understanding that I want the full thing to be the link to the image.

Is there a way to do this in HTML or PHP to tell the script that I want the full thing to be a web link?

Any help would be greatly appreciated.

Thanks,

Spec36

Re: Image not displaying in PHP script

Posted: Fri Aug 12, 2011 10:00 pm
by twinedev
Not sure, but offhand the first thing I would try would be this:

Code: Select all

<?php 
    // code here

    $strImgSrc = 'http://website.com/c-sc/sc?r=658974&chart='.urlencode('$BOB:MM.TT,uu[305,a]dacayaci[pb20!b50][dd]');
 ?>
<html>
<img src="<?php $strImgSrc; ?>">
</html
<?php 
    // more code here
?>