I would go for:

    if (isset($_REQUEST['gender'])) $_SESSION['registrationGender'] =
$_REQUEST['gender'];
    print isset($_SESSION['registrationGender']) ? "You are registered as
gender: ".$_SESSION['registrationGender'] : "Your gender is unknown";

And make no assumptions about a gender when you don't know any ;-)

On 26/08/07, Jason Cartledge <[EMAIL PROTECTED]> wrote:
>
>
> 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
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Interpotential.com
Phone: +31615397471

Reply via email to