imaging problem ??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
roehrle
Forum Newbie
Posts: 7
Joined: Sun Jul 17, 2005 8:08 am
Location: Edgewater Park NJ

imaging problem ??

Post by roehrle »

In the following code case 1,2 work but I can't get the gif image to show. The dig.gif file is in the same directory.
a missing link icon shows up instead of the image.
I think it has something to do with the quotes but can't find a solution.

Code: Select all

<?php
switch ($i) {
case 0:
   echo "<img scr="dig.gif">";
   break;
case 1:
   echo "<font size=4><font color= yellow>$oldcount</font>"; 
   break;
case 2:
   echo "<font size=4><font color= red>$newcount</font>";
   break;
}
?>
JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

u have img scr instead of img src
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

you have to escape your quotes

Code: Select all

echo "<img scr=\"dig.gif\">";
or

Code: Select all

echo '<img scr="dig.gif">';
Post Reply