help with session
| From: | Jason Cartledge | Date: | Sun, 26 Aug 2007 10:02:18 +0000 |
| Subject: | help with session | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-261289@lists.php.net to get a copy of this message | ||
Hi, this is my first post to this newsgroup. Does this code look ok or is there a more clean way of
doing this? I am learning. Thank you for reading.
Jason
if ( !empty($_REQUEST['gender']) )
{
$registrationGender=$_REQUEST['gender'];
}
else {
if (session_is_registered('registrationGender'))
{
$registrationGender=$_SESSION['registrationGender'];
print "you are preregistered as a $registrationGender";
}
else
{
print "your gender is unknown, youare assumed to be a male";
$registrationGender="male";
}
}
$_SESSION['registrationGender']=$registrationGender;
_________________________________________________________________
100’s of Music vouchers to be won with MSN Music
https://www.musicmashup.co.uk/index.html