View Single Post
Old 07-12-2008, 12:51 AM   #2 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

You can send it anywhere you want, basically.

Two options leap to mind;

Send it to itself. Include some kind of procedural code in the head of your login page that looks something like:

PHP Code:
<?php

if (isset($_POST['login']))
{
    
$pCtrl = new User_Controller;
    
$pCtrl->doLogin();
}

?>
<!-- insert form here -->
Or you can send it to an intermediary controller. I use one in a system I wrote that I send all forms to, and it determines which sub-system it needs to load, and the actions to take from there. It then sends you back to the form if there are errors, or on to whatever page should follow.

OOP is like driving in the city, there's about 30 ways to get anywhere. You could additionally contain the view inside the class, and just instantiate a new object on page load which would then determine if it needs to process the form, display the form, or redirect based on criteria you put into it's constructor.
-m
delayedinsanity is offline  
Reply With Quote