Help me make an image clickable.

images php coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
Nullsig
php-forum Fan User
php-forum Fan User
Posts: 979
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Tue Mar 15, 2011 5:52 pm

Please see my response to your post in the other thread. If my recommendation doesn't solve your problem and you need help with the other situation I proposed then just post your reply here and I will help you out as it is then a completely new topic.

User avatar
Nullsig
php-forum Fan User
php-forum Fan User
Posts: 979
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Tue Mar 15, 2011 6:06 pm

almost there... you need to change the last line to:

Code: Select all

Echo "<a href='http://www.tonerboss.com'><img src='".$image."' Style='width:575px;height:230px;'></a>"; ?>
you can't use unescaped double quotes inside of an echo string. I changed the offending quotes to single quotes and added single quotes around the style and src arguements. Not necessary but its good coding.

User avatar
webinfopedia
New php-forum User
New php-forum User
Posts: 84
Joined: Sat May 21, 2011 10:26 pm
Contact:

Sat May 21, 2011 11:44 pm

In PHP, first the coding syntax should be correct. you have to change Echo to echo, Style to style and put semicolon at the end.

Code: Select all

<?php
$image = "http://blog.tonerboss.com/wp-content/uploads/2011/03/TB-Banner-600by174banner.jpg";
echo "<a href='www.webinfopedia.com'><img src=".$image." style='width:575px;height:230px;' /></a>"; 
?>

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests