Welcome Guest, Not a member yet? Register   Sign In
Controller, view question...
#2

[eluser]Aken[/eluser]
I never mix the log in/out features with actually displaying content. For example, my admin controller would look something like this:

controller: admin.php

index() :: Check if logged in. If YES, show the page. If NO, redirect to login().

anothermethod() :: Another admin page. Do the same as index().

login() :: Check if logged in. If YES, then redirect to index() (we don't need them to log in twice). If NO, then show login form. Login form sends data back to this same method, not another. It processes supplied POST data and checks for a valid login. If YES, redirect to index(). If NO, show an error and the form again.


Messages In This Thread
Controller, view question... - by El Forum - 07-30-2012, 04:32 PM
Controller, view question... - by El Forum - 07-30-2012, 05:44 PM
Controller, view question... - by El Forum - 07-30-2012, 06:01 PM
Controller, view question... - by El Forum - 07-30-2012, 07:01 PM
Controller, view question... - by El Forum - 07-30-2012, 07:05 PM
Controller, view question... - by El Forum - 07-30-2012, 08:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB