Reputation: 1713
I want to include a dynamic name for my picture
<img src='uploads/'"<?php echo $pic; ?>">
In the above code $pic = myCatImage.jpg
But it does not work
How can I do this ?
Upvotes: 2
Views: 46
Reputation: 219804
Your quotes are off:
<img src='uploads/<?php echo $pic; ?>'>
This value goes inside the same quotes as the rest of the value of the src attribute.
Upvotes: 5