Block GET Call to method |
[eluser]Ceros[/eluser]
Hi, I know that in ASP.NET MVC there is something called AcceptVerbs. So you can do this: <AcceptVerbsOST>_ function insertdatabase(param1, param2)... Using this, when you directly call www.mysite.com/controller/insertdatabase it doesn't work. But it will if you are using a form with method="POST". Is there a way to do the same thing in CI? Thanks! Seb
[eluser]brianw1975[/eluser]
without further definition of "it doesn't work" my response is: eh....uh.... Code: if($this->input->post("submit")){
[eluser]Ceros[/eluser]
[quote author="brianw1975" date="1266205864"]without further definition of "it doesn't work" my response is: eh....uh.... Code: if($this->input->post("submit")){ And this won't work if you are using jQuery and dialog.
[eluser]Ceros[/eluser]
Nevermind, I found this: $_SERVER['REQUEST_METHOD'] Return GET or POST so all you have to do is: Code: if($_SERVER['REQUEST_METHOD'] == "POST"){
[eluser]brianw1975[/eluser]
[quote author="Ceros" date="1266210202"][quote author="brianw1975" date="1266205864"]without further definition of "it doesn't work" my response is: eh....uh.... Code: if($this->input->post("submit")){ And this won't work if you are using jQuery and dialog.[/quote] :-S seriously? you didn't think that that might be pertinent information in your OP?
[eluser]Ceros[/eluser]
Sorry, i was just searching for the equivalent of AcceptVerbs. I didn't think that jQuery would have change something. Anyway, you gave me a good hint so thank you. |
Welcome Guest, Not a member yet? Register Sign In |