C
C
Chaly952018-01-31 01:34:18
PHP
Chaly95, 2018-01-31 01:34:18

How to implement registration on two sites at the same time?

There are two sites on CMS Wordpress and CMS Opencart.
The idea is that a person who registered on the website of the online store (CMS OPENCART) could enter the forum site (CMS Wordpress) using the login and password entered during registration in the online store.
Here is such a task)
How to implement it correctly?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Ainur Valiev, 2018-01-31
@vaajnur

1. https : //nikita-sp.com.ua/2015/12/sistema-sobyitiy-...
Next, the handler

public function on_customer_add($customer_id) {
    $this->load->model('account/customer');
    $customer_info = $this->model_account_customer->getCustomer($customer_id);
    $admin_mail = $this->config->get('config_email');
// тут curlом отправляешь запрос на ВП
}

Here you send a request to the VP like "Created a new user"
2. In the VP you create a file with a script that takes data and creates
if(isset($_POST['new_register']))
     register_new_user( $user_login, $user_email );

S
stcmd04236, 2018-01-31
@stcmd04236

If you want to "implement it more correctly" then you are in the direction of OAuth. Both WP and OpenCart have the necessary plugins.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question