Welcome Guest, Not a member yet? Register   Sign In
A simple question about functions on Controller
#1

[eluser]Unknown[/eluser]
Hi everyone.
I'm developing a simple application, but i have a problem!:
- In my controller called testcon i wrote a function "add" which has 1 parameter. This parameter represent an operation.
- When access to my page 127.0.0.1/index/testcon/add/par1 then all right! In "add" function, I have a form..
- Then, the user clicked the button on the form (a submit button) and I want that he comes back to 127.0.0.1/index/testcon/add/par2. What I have to do? or to another parameter in "add" function. In my version, it always back to "index" function instead "add"
In the final part of my "add" function looks like:
Code:
if($this->form_validation->run() == FALSE)
    {
      $this->load->view('testview'); //here is the form located
    }
    else
    {
      //some code
      $this->load->view('formsuccess'); //a successful page with a link to 127.0.0.1/index/testcon/add
    }
I hope that you can understand me and help me!
Thx in advance.

esmitt




Theme © iAndrew 2016 - Forum software by © MyBB