Skip to Content Skip to Menu

Help with a synchronisation script

  • kbrookes
  • kbrookes
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
17 years 2 months ago #47347 by kbrookes
Help with a synchronisation script was created by kbrookes
Hi there,

I'm using a combination of CB and nBill to handle paid user subscriptions and product purchases.

nBill has an 'events' feature, allowing scripts put in an event folder to be triggered.

What I now need is to develop something that works the other way when someone edits their CB profile as I've restricted access to the nBill profile system after the user account is created.

Is there a hook into the system that I can use to essentially reverse the following script whenever someone edits their profile?

[code:1]<?php

$link = mysql_connect("localhost", "dbname", "password"«»)
or die("Could not connect"«»);
mysql_select_db ("dbname_joomla"«»);

$sql = "select max(id) as uid from jos_users";
$res = mysql_fetch_array(mysql_query($sql));
$user_id = $res[uid];

$address = $_POST[INV_CORE_address_1];
if($_POST[INV_CORE_address_2]!='')
$address .= ",".$_POST[INV_CORE_address_2];

if($_POST[INV_CORE_address_3]!='')
$address .= ",".$_POST[INV_CORE_address_3];

$up_sql = "UPDATE jos_comprofiler SET firstname='$_POST[INV_CORE_first_name]',
middlename='$_POST[INV_CORE_middle_name]',
lastname='$_POST[INV_CORE_last_name]',
company='$_POST[INV_CORE_company_name]',
address='$address',
city='$_POST[INV_CORE_town]',
state='$_POST[INV_CORE_state]',
country='$_POST[INV_CORE_country]',
zipcode='$_POST[INV_CORE_postcode]',
phone='$_POST[INV_CORE_telephone]'
WHERE id='$user_id' ";
mysql_query($up_sql);

?>
[/code:1]

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum