thosecars82 Posted May 15, 2008 Share Posted May 15, 2008 Hello there I am writing to ask you a really simple thing. It has to do with the img tag. I have been using php+mysql+apache so far. However, I do not know why when I use the img tag in the code below, I cannot see any image at all on my browser. What I see instead is the alt name which is "wewe" in this particular case according to the code below. file.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <img src="estilos/images/spanishflag.gif" alt="wewe" /> </body> </html> On the other hand if I rename this file so that it is file.html instead of file.php, then browsing the file file.html will let me see the image. So for me it is quite weird: I just can see the image when the extension of the file is html because if it is .php then I just see the name specified in the alt parameter of img. Since I have been stuck with this stupid thing for a while, my brain is quite tired right now. Moreover, there might be an easy answer to my doubt which I have not found yet. Anyways, I would appreciate your suggestions since I am stuck with this. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/105798-solved-img-tag-in-php-file/ Share on other sites More sharing options...
DeanWhitehouse Posted May 15, 2008 Share Posted May 15, 2008 try <?php echo "<img src='estilos/images/spanishflag.gif' alt='wewe'"; ?> instead of <img src="estilos/images/spanishflag.gif" alt="wewe" /> Quote Link to comment https://forums.phpfreaks.com/topic/105798-solved-img-tag-in-php-file/#findComment-542206 Share on other sites More sharing options...
thosecars82 Posted May 15, 2008 Author Share Posted May 15, 2008 try <?php echo "<img src='estilos/images/spanishflag.gif' alt='wewe'"; ?> instead of <img src="estilos/images/spanishflag.gif" alt="wewe" /> Thanks for that quick and effective reply, it worked great. Quote Link to comment https://forums.phpfreaks.com/topic/105798-solved-img-tag-in-php-file/#findComment-542222 Share on other sites More sharing options...
DeanWhitehouse Posted May 15, 2008 Share Posted May 15, 2008 no prob, if solved, click topic solved at the bottom Quote Link to comment https://forums.phpfreaks.com/topic/105798-solved-img-tag-in-php-file/#findComment-542235 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.