nightkarnation Posted September 10, 2008 Share Posted September 10, 2008 Ok this is a fragment of the code...here i want to display an image with the value of location inside HTML code...that is coming from mysql query... My doubt is...am i coding correctly the separation of: "<?='location'?>.jpg" //...IRRELEVANT PHP CODE ?> <img src="<?='location'?>.jpg" alt="USA" width="20" height="14" /> <?php //...GO BACK TO MORE IRRELEVANT PHP CODE Any ideas? Thanx in advance for the help!! Cheers Link to comment https://forums.phpfreaks.com/topic/123548-php-inside-html/ Share on other sites More sharing options...
The Little Guy Posted September 10, 2008 Share Posted September 10, 2008 <?php // Mysql query $row = mysql_fetch_array($sql); ?> <img src="<?= $row['location']; ?>.jpg" alt="USA" width="20" height="14" /> Link to comment https://forums.phpfreaks.com/topic/123548-php-inside-html/#findComment-638064 Share on other sites More sharing options...
nightkarnation Posted September 10, 2008 Author Share Posted September 10, 2008 Thanx a lot The Little Guy What if I want to echo inside php the following: <img src="Usa.jpg" alt="USA" width="20" height="14"> This gives me parse error: echo "<img src="Usa.jpg" alt="USA" width="20" height="14">"; Link to comment https://forums.phpfreaks.com/topic/123548-php-inside-html/#findComment-638072 Share on other sites More sharing options...
nightkarnation Posted September 10, 2008 Author Share Posted September 10, 2008 <?php // Mysql query $row = mysql_fetch_array($sql); ?> <img src="<?= $row['location']; ?>.jpg" alt="USA" width="20" height="14" /> Its not working This is the final output of the path: http://localhost/Test/HtmlPhpMysql/%3C?= $row['location']; ?>.jpg Instead of being: http://localhost/Test/HtmlPhpMysql/Usa.jpg Link to comment https://forums.phpfreaks.com/topic/123548-php-inside-html/#findComment-638079 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.