problem on return url

Hi

In home page i have a link for form3

and in another page(form2) i have a link for form3

i give a cancel button with following code

<?php echo CHtml::submitButton('Cancel',

    array('name'=>'cancel',

'submit'=>array('holiday/home'),

'params'=>array('url'=>Yii::app()->user->returnUrl) ,

'confirm'=>'Are sure without Save/Modify/Delete Type?')); ?>

when i got form3 from form2 on clicking cancel on form3 it gives homepage, how to change it when i come from homepage it have to give homepage and when i come from form2 it should display form2

how

I've created an extension for this kind of problem. Check it out here:

http://www.yiiframew…on/xreturnable/

See the examples contained in the extension to understand what you can do with it.

problem solved by passing value in form2 linkbutton and checked it by $_GET in form3

in homepage link button 

CHtml::linkButton('Add/Modify Type', array(

    'submit'=>array('holiday/addmodifydeletetype'),

    'params'=>array('url'=>Yii::app()->request->url),

));

in form2

CHtml::linkButton('Add/Modify Type', array(

    'submit'=>array('holiday/addmodifydeletetype','test'=>'test'),

    'params'=>array('url'=>Yii::app()->request->url),

    ));

in form3

<?php if(isset($_GET['test'])) {

echo CHtml::submitButton('Cancel',

    array('name'=>'cancel',

'submit'=>array('holiday/addModifyDelete'),

'params'=>array('url'=>Yii::app()->user->returnUrl) ,

'confirm'=>'Are sure without Save/Modify/Delete Type?'));

}

else

{

echo CHtml::submitButton('Cancel',

    array('name'=>'cancel',

'submit'=>array('holiday/login'),

'params'=>array('url'=>Yii::app()->user->returnUrl) ,

'confirm'=>'Are sure without Save/Modify/Delete Type?'));

}

?>