Consult the expert: data import and export between two php platforms

Source: Internet
Author: User
Consult the expert: data import and export between two php platforms PHP moodle data transmission

Requirements:
The student information (user name, password, name, email, and professional code) on the enrollment platform is imported to the corresponding data table in the moodle platform database,
Enables students to log on to the moodle system using their usernames and passwords on the moodle platform for online learning and course quizzes,
After the test is completed, the score (user name, professional code, course name, course score) of the students is exported to the enrollment platform. the students can view their score information.
Requirements:
These operations are automatically updated at every day to automatically import and export student information and student scores.
Now I need to write a script file and execute it regularly. please advise me what is the main step of this function? what kind of transition storage, array or file should be used for data transmission between different databases on different platforms? Or session or cookie?
Online ......


Reply to discussion (solution)

I have never done it. I 'd like to give you some ideas.

Data Transmission Interface. platform B regularly executes the php file every day and requests the corresponding interface of Platform A. Platform A sends new data to Platform B through the interface. platform B receives the data and enters the database.

You can use shell scripts.

Can the two platforms directly access the database? if possible, you can directly use shell scripts to insert database B from database.

If not, you need to develop response interfaces.

Insert the database to actively pull data:
The registration platform must provide interfaces for obtaining user information in batches.
The moodle platform provides an interface for batch score information

Insert database passive update data:
The registration platform must provide an interface for inserting score information in batches.
The moodle platform provides an interface for batch inserting user information

Both parties can use post json for communication or directly download txt files.

However, the above are closely related inserts, not updates. for example
User a is already on the moodle platform, but User a's password has been changed on the enrollment platform. how does user a synchronize this password?
You cannot update all users at a time.

Therefore, the best way is to provide sso on the enrollment platform, so it is King to keep the registration platform and the moodle platform synchronized login and logout.

First, determine the database. if possible, use a third-party tool.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.