Welcome Guest, Not a member yet? Register   Sign In
How to sole the problem of accessing form action function directly in URL?
#9

[eluser]Matalina[/eluser]
I use to do it the way you are with two methods but now I use one method. I dislike on errors having the create_do showing up in the url.

So I use one function for both display and processing.

Code:
// Do all processing for display of form first

// Check if the form was submitted
if($this->input->post('submit_button_pressed') {
// If the form was submitted process the form here
if($this->form_validation->run) {
  // If the form validated process then redirect to with success flash data message
}
}

// If there was an error in the form or the form was not submited get view to display
}


Messages In This Thread
How to sole the problem of accessing form action function directly in URL? - by El Forum - 03-26-2012, 06:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB