boumbo Posted April 25, 2012 Share Posted April 25, 2012 <?php $visitpage = "http://mywebsite.com/wp-content/uploads/test.jpg"; ?> <div style="text-align: center;"><img src=<?php echo $visitpage; ?>/></div> do you know why the image is not appearing in the coe above? why my syntax of php and html is wrong? Quote Link to comment https://forums.phpfreaks.com/topic/261609-newbie/ Share on other sites More sharing options...
Drummin Posted April 26, 2012 Share Posted April 26, 2012 See about quoting your link. <div style="text-align: center;"><img src="<?php echo $visitpage; ?>" /></div> Quote Link to comment https://forums.phpfreaks.com/topic/261609-newbie/#findComment-1340548 Share on other sites More sharing options...
scootstah Posted April 26, 2012 Share Posted April 26, 2012 I think you are confused because you have quotes in the variable, so you assume there will be quotes for the src attribute. This, as you can see, is not the case. You will need to add the quotes around the src attribute as Drummin has shown. Quote Link to comment https://forums.phpfreaks.com/topic/261609-newbie/#findComment-1340553 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.