tags:

views:

52

answers:

4

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...

+8  A: 

Not sure if I completely understand, but try this:

echo '<img src="/uploads/'.$photo->name.'"/>';
Alex B
Just a word of caution. Please encode your output with htmlspecialchars.
The Pixel Developer
A: 

echo '<img src="/uploads/'.$photo->name.'"/>';

Paul Tomblin
A: 

How about

 echo '<img src="/uploads/'.$photo->name.'"/>';

... unless I'm missing something?

Alex JL
+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