How To Pass Textfield Value To Another Page?

I want to pass input from test.php show in ttt.php, how to do?

test.php




<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(

    'id'=>'test',

    'type'=>'horizontal',

    'enableClientValidation'=>true,

    'clientOptions'=>array(

        'validateOnSubmit'=>true,

    ),

)); ?>


<div class="form">

    <?php echo CHtml::beginForm(); ?>


    <?php echo CHtml::errorSummary($model); ?>


    <div class="row">

        <?php echo CHtml::Label('Q_number',''); ?>

        <?php echo CHtml::TextField('Name','', array('id' => 'Name'));?>

    </div>


    <div class="row submit">

        <?php echo CHtml::submitButton('Login',array('name' => 'Login')); ?>

    </div>


    <?php echo CHtml::endForm(); ?>


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

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



ttt.php




<?php

echo "hi".'<br>';

echo $_POST['text'];



controller




public function actionttt(){

    $this->render('ttt');

}

public function actionTest(){

    $model = new Customers();

    if(isset($_POST['Login']))

        $this->redirect(array('customers/ttt'));

    $this->render('test',array('model'=>$model));

}



change the action like this…




public function actionTest(){

    $model = new Customers();

    if(isset($_POST['Login']))

        $this->redirect(array('customers/ttt',array('text'=>$_POST['text'])));

    $this->render('test',array('model'=>$model));

}



ttt.php




<?php

echo "hi".'<br>';

echo $_REQUEST['text'];



error Undefined index: text

$_POST[‘text’] – Means you text box name

Here you textbox name is "Name", so replace text to "Name"…

erroe




 Undefined index: text


C:\xampp\htdocs\test\protected\views\customers\ttt.php(3)


1 <?php

2 echo "hi".'<br>';

3 echo $_REQUEST['text'];




you can check the values whether it is set or not by using


 echo '<pre>';

print_r($_REQUEST);

echo '</pre>';