TheFilmGod Posted February 20, 2007 Share Posted February 20, 2007 I'm using html to load a pic. <img src="image/1.jpg"> but to make it easy I want to make the "1" in the above to be a php variable so that I can edit it easy. Here is my code: <html> ... <?php $num="1"; ?> ...... <img src="image/<?php $num; ?>.jpg"> why doesn't it work? Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 20, 2007 Share Posted February 20, 2007 You're not printing the variable. <img src="image/<?=$num?>.jpg"> or <img src="image/<?php print $num; ?>.jpg"> Quote Link to comment 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.