Gavin Lau
Gavin Lau

Reputation: 19

php anchor tag with image in between

hello i keep getting an error message when i try to place a image file inbetween 2 anchor tags. i am using echo for the obvous reason i am using php but i get this message when i try to refresh the page:

*Parse error: syntax error, unexpected '<' in E:\Game Downloads\Applications\Xampp\htdocs\WEBSITE DESIGN(PHP)\signed_in.php on line 189*

below is what i have got so far but ive been messing around with the way the speech marks are used and the quotation marks

echo"<div class='add_to_cart'>";
   echo"<a href='#'>""<img src='Images/ADD-TO-CART-copy-4.png' />" "</a>";
echo"</div>";

Upvotes: 1

Views: 717

Answers (3)

Nadeem Khan
Nadeem Khan

Reputation: 3424

Try this:

echo "<div class='add_to_cart'><a href='#'><img src='Images/ADD-TO-CART-copy-4.png' /></a></div>";

Upvotes: 1

merc_shadow
merc_shadow

Reputation: 1

Try this:

print '<div class="add_to_cart">';
print '<a href="#"><img src="Images/ADD-TO-CART-copy-4.png" /></a>';
print '</div>;

or similarily:

print '<div class="add_to_cart"><a href="#"><img src="Images/ADD-TO-CART-copy-4.png" /></a></div>';

Upvotes: 0

Abhik Chakraborty
Abhik Chakraborty

Reputation: 44844

Make it simple as below -

echo  '<a href="#"><img src="Images/ADD-TO-CART-copy-4.png" /></a>';

Upvotes: 1

Related Questions