Submit to new view in CodeIgniter
I have one controller with an index()
and a newFun开发者_JAVA百科ction()
. When my index function loads, it loads the first view that I need. I have a submit button on that view:
<div class="btn"><input type="submit" name="submit" id="submit_button" value="Pay"></input></div>
I want that submit button to load the newFunction()
, as the new page, right now it is loading the newFunction()
/view under the index view.
This is what I call in my index function to try and get the new view to load as a new page. Except it loads it right under it.
$submit = $this->input->post("submit");
if($submit == "Pay") {
$this->pay($postData);//pay is the name of newFunction();
}
public function index()
{
if($this->input->post("submit") == "Pay")
{
$this->pay($postData);//pay is the name of newFunction();
return; // With this, rest of the code wont execute.
}
}
精彩评论