Re: help with session
| From: | mike | Date: | Sun, 26 Aug 2007 10:18:20 +0000 |
| Subject: | Re: help with session | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-261290@lists.php.net to get a copy of this message | ||
On 8/26/07, Jason Cartledge <jason1096@hotmail.co.uk> wrote:
I would replace $_REQUEST with $_GET or $_POST (as appropriate)
> if ( !empty($_REQUEST['gender']) )
> {
> $registrationGender=$_REQUEST['gender'];
> }
> else {
Personally I would use if(isset($_SESSION['registrationGender'])) here
> 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";
$_SESSION['registrationGender']='male';
I would change it to assign it here. No need to assign it a second
time below, since you are just printing the session variable if it is
already set
> }
> }
>
Those are a couple quick things my tired bloodshot eyes thought of.