hya i have 2 user goups in my website one for couples and one for singles what im wanting to know is when a couple registers how can i direct them to a couples directory ive tried the following but its not doing it can anyone help with this

if( $gender == 'female' ) {
        //Redirect administrators to the dashboard
        header("location: registration2.php");
    } elseif ( $gender == 'males' ) {
        //Redirect shop managers to the dashboard
        header("location: registration2.php");;
    } elseif ( $gender == 'couples' ) {
        //Redirect editors to the dashboard
        header("location: cregistration2.php");
    } elseif ( $gender == 'tvtscd' ) {
        //Redirect authors to the dashboard
        header("location: registration2.php");
    }

Recommended Answers

All 7 Replies

Member Avatar for diafol
if( $gender == 'female' || $gender == 'males' || $gender == 'tvtscd' ) {  //why female singular / males plural?? 
    header("Location: registration2.php");
}else{
    header("Location: cregistration2.php");
}
exit;

Ensure that the locations exist. Are your swingers getting lost?

Ty hun solved x

hi hun this works when choosing a couple but when choosing a male or female it goes straight to cregistration2php not registration2.php hun

Member Avatar for diafol

This mens $gender does not hold ny of those values then. If you echo $gender to the screen and comment out (//) the headers, you should see what they hold.

its not echoing anything through ive refreshed the page with echo $gender; inside and // the headers hun

as in

    if( $gender == 'female' || $gender == 'males' || $gender == 'tvtscd' ) {  //why female singular / males plural?? 

        echo $gender;
    //header("Location: registration2.php");
}else{
    //header("Location: cregistration2.php");
}
exit;
Member Avatar for diafol

As I thought. Your code is knackered somewhere earlier.

as the comented refer to different /members, it looks like a modyfied script. i would check the form field names that sends to this. just a guess

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.