how to use the data from a form?

typostudy

Member
In my template, I have a form,
Code:
 <form name="search" method="post" >
Seach for: <input type="text" name="find" />
...
<input type="submit" name="search" value="Search" />
</form>
in my controller file, I am trying to get the input value, and echo it,
Code:
 public function actionIndex()
    { 
        $find = $this->_input->filterSingle('find', XenForo_Input::STRING);
        $viewParams= array();
        echo $find;
        ...
        return $this->responseView('Velop_ViewPublic_Tel_Index', 'my_template', $viewParams
        );
    }

But in front end, when i input a text, then press submit button, it shows 'Security error occurred. Please press back, refresh the page, and try again.'
I guess maybe i need to do something with 'action' in the form. but i am not sure, so anyone can help me with this?
 
I have figured it out, i just put action = "{xen:link mypage}" there, and it works

In my template, I have a form,
Code:
 <form name="search" method="post" >
Seach for: <input type="text" name="find" />
...
<input type="submit" name="search" value="Search" />
</form>
in my controller file, I am trying to get the input value, and echo it,
Code:
 public function actionIndex()
    {
        $find = $this->_input->filterSingle('find', XenForo_Input::STRING);
        $viewParams= array();
        echo $find;
        ...
        return $this->responseView('Velop_ViewPublic_Tel_Index', 'my_template', $viewParams
        );
    }

But in front end, when i input a text, then press submit button, it shows 'Security error occurred. Please press back, refresh the page, and try again.'
I guess maybe i need to do something with 'action' in the form. but i am not sure, so anyone can help me with this?
 
Top Bottom