2 php systems

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vaninoui
Forum Newbie
Posts: 1
Joined: Mon Oct 27, 2008 2:20 am

2 php systems

Post 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 ?
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: 2 php systems

Post 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...)
Post Reply