Reputation: 953
i have this problem i hope some of you can help me with. I try to make a html link that get the link from my database.
echo "<p><pre><a href=$Feed['socialfacebook']><img src=facebook-24.png></a></pre></p>
Upvotes: 0
Views: 74
Reputation: 480
Double-quoted strings don't work with array elements quite like that. You should close and concatenate the strings.
echo "<p><pre><a href=".$Feed['socialfacebook']."><img src=facebook-24.png></a></pre></p>"
You might also want to put some quotes on your attributes.
Upvotes: 1
Reputation: 35
u need to put the variable $Feed['socialfacebook']
in " . $Feed['socialfacebook'] ."
echo "<p><pre><a href=" . $Feed['socialfacebook'] . "<img src=facebook-24.png></a></pre></p>";
and don't forget the ;
Upvotes: 0
Reputation: 43
Shouldn't it be:
echo "<p><pre><a href='$Feed["socialfacebook"]'><img src=facebook-24.png></a>";
Don't forget that is href=""
.
Upvotes: -1
Reputation: 36784
echo "<p><pre><a href='$Feed[socialfacebook]'><img src=facebook-24.png></a>";
Upvotes: 1
Reputation: 73221
You need to put the link in '".$variable ."'
and the image src should be in ' ', too.
echo "<p><pre><a href='".$Feed['socialfacebook']."'><img src='facebook-24.png'></a></pre></p>";
Upvotes: 2