Re: $POST and $_SESSION

From: Date: Sat, 17 Mar 2012 17:01:17 +0000
Subject: Re: $POST and $_SESSION
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-317085@lists.php.net to get a copy of this message
On 3/17/2012 12:52 PM, Al wrote:
On 3/15/2012 11:04 AM, Tedd Sperling wrote:
$first_name = $_SESSION['first_name'] ? $_SESSION['first_name'] : null; $first_name = isset($_POST['first_name']) ? $_POST['first_name'] : $first_name; $_SESSION['first_name'] = $first_name;
$_SESSION['first_name'] = (isset($_POST['first_name']))? $_POST['first_name']:(isset($_SESSION['first_name']))? $_SESSION['first_name']:null;
Another benefit is that the variable, $_SESSION['first_name'], doesn't need to be assigned before hand.

« previous php.general (#317085) next »