how to create a linked image?

images php coding issues or problems here.

Moderators: macek, egami, gesf

bltaug3
New php-forum User
New php-forum User
Posts: 5
Joined: Fri Oct 22, 2010 1:11 pm

how to create a linked image?

Postby bltaug3 » Tue Oct 26, 2010 6:56 am

I'm working off previously created php coding, and am trying to figure out how to change a text link to an image. The code uses the link function, so I can't figure how what variable I can put in to get the image to show properly. The function of the button is a next/previous link for a catalog of products. Here's the current code:

Code: Select all

<?php echo $this->Html->link('<< Previous Product',array('controller'=>'products','action'=>'view', $product['Product']['id']-1)); ?>
<br/>
<?php echo $this->Html->link('Next Product >>',array('controller'=>'products','action'=>'view', $product['Product']['id']+1)); ?>

I tried declaring a variable $prevbtn equal to <img src="http..."> and replacing the current '<< Previous Product' with that $prevbtn but that just displays the html src code.

Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 1 guest