Try this:
<?php $myimage = "http://pear.php.net/gifs/pearsmall.gif"; echo '<img src="$myimage">'; ?>
Probably you are not initializing the $myimage var.
To see if the html generated is ok, you can use your browser "view source" capability.
Henri marc wrote:
Hello,
I would like to use a variable instead of an image file name in a html page with this instruction:
<?php echo '<img src="$myimage">'; ?>
I tried but the image doesn't show up. Is it impossible or do I do something wrong? My goal is to have a random image print in the page, that's why I want to use a variable.
Thank you for your good advices.
Vous manquez d’espace pour stocker vos mails ? Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis. A télécharger gratuitement sur http://fr.messenger.yahoo.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php