I do not want to allow access to a controller by url |
[eluser]MrAmine[/eluser]
hi evryone I do not want to allow access to a controller by url how can i do
[eluser]mdvaldosta[/eluser]
Don't have an index function and prefix all your functions with an underscore.
[eluser]eoinmcg[/eluser]
it's all in the manual: http://ellislab.com/codeigniter/user-gui...llers.html the index() method is what CI will load if no method is specified in the url eg http://example.com/my_app/blog will execute the index method in the blog controller. if there is no index method for the blog controller a '404 not found' error will be shown. also prefixing your methods with an underscore means that they are private and not accessible by url.
[eluser]WanWizard[/eluser]
If you don't want access to the controller via the URL, what are you going to do with that controller then? Because in stock CI, you can't use controllers internally...
[eluser]InsiteFX[/eluser]
If its a specific controller like only for an admin then check to see if the logged in user is an admin if not redirect them back to the home page! InsiteFX
[eluser]Nur Cholikul Anwar[/eluser]
Maybe you need a authentication programe |
Welcome Guest, Not a member yet? Register Sign In |