Re: $POST and $_SESSION

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux