Hello there, I getting crazy trying to echo an <img>
tag I want to add this simple string "/uploads/"
before $photo->name
...Here is my echo: echo '<img src="'.$photo->name.'"/>';
thanks for any help...
views:
52answers:
4
+8
A:
Not sure if I completely understand, but try this:
echo '<img src="/uploads/'.$photo->name.'"/>';
Alex B
2010-07-31 22:05:26
Just a word of caution. Please encode your output with htmlspecialchars.
The Pixel Developer
2010-07-31 23:24:39
A:
How about
echo '<img src="/uploads/'.$photo->name.'"/>';
... unless I'm missing something?
Alex JL
2010-07-31 22:06:19
+1
A:
Here you go:
echo '<img src="/uploads/'.$photo->name.'"/>';
Or:
echo '<img src="' . '/uploads/' . $photo->name.'"/>';
Or:
echo '<img src="' . "/uploads/" . $photo->name.'"/>';
Jauzsika
2010-07-31 22:06:38