paulman888888 Posted June 5, 2008 Share Posted June 5, 2008 I have got my php code but i dont know how to put a link with an image my code echo "<td>".$row['location']."</td>\n"; how can i have an image that has a link to location? i thought of this but i think its wrong echo "<td><a href='".$row['location"]."'><img src="images/downloadsm.png" /></a></td>\n"; Please help Link to comment https://forums.phpfreaks.com/topic/108884-quick-question/ Share on other sites More sharing options...
jonsjava Posted June 5, 2008 Share Posted June 5, 2008 <?php $location = $row['location']; echo "<td><a href='$location'><img src="images/downloadsm.png" /></a></td>\n"; ?> Link to comment https://forums.phpfreaks.com/topic/108884-quick-question/#findComment-558558 Share on other sites More sharing options...
paulman888888 Posted June 5, 2008 Author Share Posted June 5, 2008 i cant use that because its coming out of a mysql database. Link to comment https://forums.phpfreaks.com/topic/108884-quick-question/#findComment-558560 Share on other sites More sharing options...
jonsjava Posted June 5, 2008 Share Posted June 5, 2008 I just reused your code, fixing one small thing, and restructuring something to make it look nicer. It's your code. I'm betting you can use it. Link to comment https://forums.phpfreaks.com/topic/108884-quick-question/#findComment-558561 Share on other sites More sharing options...
paulman888888 Posted June 5, 2008 Author Share Posted June 5, 2008 found it its that echo "<td><a href='".$row['location']."'><img src="images/downloadsm.png" /></a></td>\n"; Link to comment https://forums.phpfreaks.com/topic/108884-quick-question/#findComment-558562 Share on other sites More sharing options...
discomatt Posted June 5, 2008 Share Posted June 5, 2008 The issue here is unescaped quotes, i believe <?php echo '<td><a href="'. $row['location'] .'"><img src="images/downloadsm.png" /></a></td>'."\n"; ?> Link to comment https://forums.phpfreaks.com/topic/108884-quick-question/#findComment-558615 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.