Re: Session: I RTFM

From: Date: Sat, 14 Dec 2002 23:39:35 +0000
Subject: Re: Session: I RTFM
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-128306@lists.php.net to get a copy of this message
I haven't followed the rest of the thread, but how about using a function? function getvar ($varname) { if (isset ($_POST[$varname]) { $_SESSION[$varname] = $_POST[$varname]; return $_POST[$varname]; } elseif (isset ($_SESSION[$varname])) return $_SESSION[$varname]; } session_start(); // You don't need session_register anymore $familyname = getvar('familyname'); and so on--just one line per variable. Hope this helps. Cheers, Marco -- ------------ php|architect - The Magazine for PHP Professionals The monthly magazine dedicated to the world of PHP programming Check us out on the web at http://www.phparch.com!

« previous php.general (#128306) next »