0

hya i have a website built in php html and javascript and at the moment when a couple registers they go straight to a single persons profile page and i want to going to a couples profile page where both there information is stored how can i do this

any help much needed x

2
Contributors
1
Reply
15
Views
2 Years
Discussion Span
Last Post by veedeoo
0

you can achieved this by storing the member's status on the database.

for example,

+ user_id + user_name + status  + couple_id +
+---------+-----------+---------+-----------+
+    1    +  husband  + married +    2      +
+---------+-----------+---------+-----------+
+    2    +  wife     + married +    1      +
+---------+-----------+---------+-----------+

So if either one or both are logged in , we can assign their status in session

session_start();

if($_SESSION['logged_in']){

    ## set session for the status, couple_id

   if(!isset($_SESSION['status']) || (empty($_SESSION['status']))){
       $_SESSION['status'] = $row['status'];
       $_SESSION['username'] = $row['username'];
       $_SESSION['couple'] = $row['couple_id'];
   }

   }

use the session as the determinant as to where the user should go..

    if(isset($_SESSION['status']) && isset($_SESSION['username']) && ($_SESSION['logged_in'])){

        ## redirect to a couple page
        ## send a mysql query to retrieve both of the members profile data.

        }

    else{

            ## redirect to a single page
    }

there are so many derivatives in doing what you want and my example is just one of them..

Edited by veedeoo: more info added

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.