$POST and $_SESSION
| From: | Tedd Sperling | Date: | Thu, 15 Mar 2012 15:04:26 +0000 |
| Subject: | $POST and $_SESSION | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-317016@lists.php.net to get a copy of this message | ||
Hi gang:
What's a better/shorter way to write this?
$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;
Cheers,
tedd
_____________________
tedd.sperling@gmail.com
http://sperling.com