On Sat, 02 Aug 2003 15:15:05 GMT, Ralph Freshour <ralph@primemail.com>
scrawled:
[color=blue]
>I'm trying to dynamically load a .jpg image into a html form <Img tag
>using a PHP variable that holds the filename of the image but no image
>is displaying (the file is there and works because if I manually type
>in the filename the <Img tag works) - how can I get PHP's variable to
>be seen as the filename?
>
>Thanks...
>
><?php
>print '<IMG SRC="$php_photo2_file" WIDTH="268" HEIGHT="176" BORDER="0"
>ALT="">';
>?>[/color]
RTFM,
You are using "single quotes" which don't get expanded, only "double
quotes" have their content interpolated.
Why not...
<IMG SRC="<?php echo $php_photo2_file ?>" WIDTH="268"
HEIGHT="176" BORDER="0" ALT="" />
much simpler and easier to understand..., if not you can could do...
<?php
echo '<IMG SRC="',$php_photo2_file,
'" WIDTH="268" HEIGHT="176" BORDER="0" ALT="" />;
?>
or
<?php
echo "<IMG SRC=\"$php_photo2_file\" WIDTH=\"268\" HEIGHT=\"176\"
BORDER=\"0\" ALT=\"\" \/>";
?>