1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to use the data from a form?

Discussion in 'XenForo Development Discussions' started by typostudy, May 20, 2013.

  1. typostudy

    typostudy Member

    In my template, I have a form,
     <form name="search" method="post" >
    Seach for: <input type="text" name="find" />
    <input type="submit" name="search" value="Search" />
    in my controller file, I am trying to get the input value, and echo it,
     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?
  2. typostudy

    typostudy Member

    I have figured it out, i just put action = "{xen:link mypage}" there, and it works


Share This Page