Click to See Complete Forum and Search --> : Variables and images


Handsofmodder
07-26-2008, 09:43 PM
I'm trying to load an image using a variable, but all I get is a blanck page. Here's the code

<body>
<?php
$image='"http://www.simpsoncrazy.com/gallery/images/BartSimpson8.gif"';

print '<html><img src=$image/></html>'

?>
</body>
</html>

NogDog
07-27-2008, 12:42 AM
Variables are not interpolated within single-quoted strings.

print '<html><img src='.$image.'/></html>';

...or...

print "<html><img src=$image/></html>";