send field with GET

How can send Get parameters in the Post form:

I want to send hidden field with method get.

(/index.php?r=site/register&u=2)


<?php $form=$this->beginWidget('CActiveForm', array(

 'id'=>'user-form',

 'enableAjaxValidation'=>false,

)); ?>

 <p class="note">Fields with <span class="required">*</span> are required.</p>

 <?php echo $form->errorSummary($model); ?>

 <div class="row">

 <?php echo $form->labelEx($model,'username'); ?>

 <?php echo $form->textField($model,'username',array('size'=>60,'maxlength'=>255)); ?>

 <?php echo $form->error($model,'username'); ?>

 </div>

///////////////////////////////////////

 <?php if($_GET['u'] != ''): ?>

 <?php echo CHtml::hiddenField('u',$_GET['u'],array('id'=>'hidden'))?>

 <?php endif; ?>

//////////////////////////////////////

 <div class="row buttons">

 <?php echo CHtml::submitButton('Register'); ?>

 </div>

<?php $this->endWidget(); ?>

</div><!-- form -->

<?php endif; ?>

hi

i think that methode of form is get Or post! Not both together

I’m not clear what U are trying to do, do U want to send both GET and POST or just to collect some GET param and print it in some form field?

why don’t you just do a simple post request and send extra params as hidden field