tags:

views:

61

answers:

2

Hi, In my Cakephp code i am having the following code. If i click on the image delete it moves to the link in href.

in the href i dont know how to give my php value .I tried with like below But it didnt works ..


   <a href="http://localhost/cake_1.2.1.8004/index.php/forms/delete/"&lt;?php echo $r['Form']['id'];?> >
    <img border="0" alt="Delete" src="/cake_1.2.1.8004/app/webroot/img/delete.png"/>
  </a>

Please suggest me..

+2  A: 

Put your echo in your quotes:

<a href="http://localhost/cake_1.2.1.8004/index.php/forms/delete/&lt;?php echo $r['Form']['id'];?>">
    <img border="0" alt="Delete" src="/cake_1.2.1.8004/app/webroot/img/delete.png"/>
</a>
Andrew Moore
Ya it works now ..Thank U..
Aruna
+4  A: 

use cakephp view helpers:

<?php
    echo $html->link(
        $html->image('delete.png'),
        array('action'=>'delete', $r['Form']['id']),
        array(),
        'really delete?',
        false
    );
?>
evilbloodydemon