suttercain Posted June 19, 2007 Share Posted June 19, 2007 Hi guys, I am trying to get a simple gif to echo out to the browser. When I run: echo "<img src=\"http://localhost/ARB/checked.gif\"/>"; or echo "<img src=\"checked.gif\"/>"; I just get the code printed to the browser. Any ideas? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/56278-cant-get-an-image-to-echo/ Share on other sites More sharing options...
GingerRobot Posted June 19, 2007 Share Posted June 19, 2007 Are you sure your host supports php? Did you remember to save the file with the extension .php? Try saving this a file with this text: <?php phpinfo(); ?> As phpinfo.php and opening it. What do you see? Quote Link to comment https://forums.phpfreaks.com/topic/56278-cant-get-an-image-to-echo/#findComment-278012 Share on other sites More sharing options...
suttercain Posted June 19, 2007 Author Share Posted June 19, 2007 Hi Ginger, Yes I am running WAMP and am using php in many other documents on the LOCALHOST. Quote Link to comment https://forums.phpfreaks.com/topic/56278-cant-get-an-image-to-echo/#findComment-278014 Share on other sites More sharing options...
GingerRobot Posted June 19, 2007 Share Posted June 19, 2007 And are you sure you've remembered to open php (perhaps you've used a short opening tag, and short_open_tags is off?) I hope im not sounding patronizing, i just expect its something silly. Quote Link to comment https://forums.phpfreaks.com/topic/56278-cant-get-an-image-to-echo/#findComment-278016 Share on other sites More sharing options...
siwelis Posted June 19, 2007 Share Posted June 19, 2007 I'd try it in a different browser, (try refreshing the page first, though you've probably done that 30 times) Also, try putting it into a variable first just to see what happens... i.e. $echoiticommandyou = "<img src=\"checked.gif\"/>"; echo $echoiticommandyou; Quote Link to comment https://forums.phpfreaks.com/topic/56278-cant-get-an-image-to-echo/#findComment-278025 Share on other sites More sharing options...
gterre Posted June 19, 2007 Share Posted June 19, 2007 Try This <?php echo '<img src="checked.gif">'; echo '<img src="http://localhost/ARB/checked.gif">'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/56278-cant-get-an-image-to-echo/#findComment-278035 Share on other sites More sharing options...
suttercain Posted June 21, 2007 Author Share Posted June 21, 2007 Hi guys, Okay I just tried running this code: <?php echo '<img src="checked.gif">'; echo '<img src="http://localhost/ARB/checked.gif">'; ?> and it printed <img src="checked.gif"><img src="http://localhost/ARB/checked.gif"> to the browser. When I try to view the image by typing in http://localhost/ARB/checked.gif and the image showed up. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/56278-cant-get-an-image-to-echo/#findComment-279296 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.