Re: Image and variable
| From: | Alfonso Baqueiro | Date: | Tue, 10 Aug 2004 12:00:55 +0000 |
| Subject: | Re: Image and variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-193258@lists.php.net to get a copy of this message | ||
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