NYCPHP Meetup

NYPHP.org

[nycphp-talk] User Login / Auth Class - SIMPLISTIC please

Mitch Pirtle mitchy at spacemonkeylabs.com
Wed Jan 28 18:52:59 EST 2004


-sry wrote:

> ya' got something to cut n' paste that's *this* simple? :)

Ok, but only for you ;^)

First is the form where they plug in whether they are Roger Rabbit or 
not.  On the next page:

// begin php code
$_SESSION['who'] = $_POST['name'];
$_SESSION['what'] = 'step two';
$_SESSION....

That should do it for you.  Then, on the third page:

if($_SESSION['what']!='step two') {
	// ok, they didn't submit the form, did they?
	include('form_two.php');
} else {
	// got form_two, move along
	include('form_three.php');
}

I mean, that's almost as easy as it gets...  The only thing making this 
easier would be using GET for your forms, and just doing everything out 
in the open in the URL!  I mean, I'm feeding two kids and changing a 
diaper while writing this.

I still think the true 'lazy' method would be to use 
PEAR::HTML_QuickForm to generate your forms (and client-side javascript 
validation), PHP4's built-in session support, and PEAR::DB for database 
access.  That's obviously IMNSHO, though ;^P

-- Mitch



More information about the talk mailing list