Welcome Guest, Not a member yet? Register   Sign In
Call a controller only if form submitted - disallow manual entry of URI
#1

[eluser]jahboite[/eluser]
If I'm using a controller that is supposed to be called only upon submission of a form, how do I ensure that if the URI is typed into the browser address bar, the controller is not called?

I've worked around this issue, by submitting a hidden field with the form and then, in the controller, I check if isset and redirect to the default controller if it isn't
(if it is, I unset it because I'm using: $this->db->insert('table_name',$_POST) ).

This make sense? Is there a CI inbuilt way to do this that doesn't remove the URI functionality for controllers that I would allow to be called from the address bar?

Does anyone have any suggestions for better ways to do this?


Messages In This Thread
Call a controller only if form submitted - disallow manual entry of URI - by El Forum - 10-22-2007, 04:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB