Page 1 of 1
What is wrong with this echo ??
Posted: Sun Feb 06, 2011 6:34 am
by Leftfield
Hi..
What is wrong with this
Code: Select all
echo '<br/><br/> <img src="images/rooms/$row[ImageUrl]" border=0>';//I want to display the imageurl but the url is wrong
How to ecscape to show vairable instread of $row img url ....
Re: What is wrong with this echo ??
Posted: Sun Feb 06, 2011 6:54 am
by divedj
There are a couple of ways to do this. If you are still in php this one works:
Code: Select all
<?php
echo "<br/><br/> <img src=\"images/rooms/".$row[ImageUrl]."\" border=0>";
?>
To make html formating easier you could also do this:
Code: Select all
<?php
// some php code here
?>
<br/><br/>
<img src="images/rooms/<?php echo $row[ImageUrl]; ?>" border=0>
Check the file folder from which you are calling your image url. If it is in a different directory you might have to use the following to get to your image url:
"../images/........
or
/images/rooms/.....