Page 1 of 1

2 php systems

Posted: Mon Oct 27, 2008 2:29 am
by vaninoui
Hello, I have 2 php systems setup on the same server and sharing the same database !
They both have a table called (dbprefix)users which stores informations about users register on their system .They have common fields but also dinstict fields.
What i whant to do is have the one register form to create the user in both systems ?

System one works with post method to insert users
System 2 works with api
for inserting users to the second system :

require_once ( '/path_to/the_api_folder/api_users.php' );

// initiate the class
$api = new Login_api_users ();


// Adds a new user

$args = array
(//associative array with arguments
'username' => 'the username of the new member',
'password' => 'the password of the new member',
'email' => 'the pemail of the new member',
'level_access' => 'level_access/role id/group id',
'active' => 'status (0=inactive, 1=active, 2=suspended)',
'user_form_data'=> 'any custom form fields (associative array)',
);

$api->add_user ( $args );

to you have any suggestion on how i should move forward to solve this ?

Re: 2 php systems

Posted: Mon Oct 27, 2008 3:02 am
by jaoudestudios
I wouldn't create the user twice, because when the user wants to edit any of their personal details you need to edit both databases (plus its redundant data). I would modify the systems to share 1 table of users and create a kind of simple realm system so you can restrict users access to each system as required - similar to google (adwords, webmaster, statistics etc...)