How to embed mysql db content on third-party sites without providing remote access

I am writing a set of HTML-based resources stored in mysql db on our server. Resources contain links to images that are stored as relative paths.

I can enter the admin panel and easily create and edit resources.

This bit is executed and works well.

However, we want to provide this resource in two ways: packaged and hosted. A solution that creates real problems is a hosting solution:

We want to host the database and all image resources, however we want to provide access to resources using a set of templates to host other users on our own site. This means that they can label templates accordingly and have an available resource at their own URL, for example.

http://www.example.com/discojoe

There are two questions in this process that cause me real headaches:

• I recognize the obvious impact of security on providing even read-only access to our mysql server. The only alternative that I think of is some kind of server-side code that runs on our server, which, upon request, queries the user for the requested data. This eliminates the need to connect mysql to them.

, , , ?

• , ( ), SRC HTML-. , URL- , , srcs URL-, .

+3
2

mysql. , , , , . mysql.

REST API ( JSON), PDO ( SQL-). . , , , , , API. , , CSRF ($token = md5(uniqid(rand(), TRUE));). , entropy, , . , oauth.


mod_rewriting URL-.

, ( ), SRC HTML-. , URL- , , srcs , URL, .

, . jquery

+2

- REST. , HTTP-, , , URL- ( ) HTML ( CSS).

, -, HTTP -, .

, iframe. iframe .

, - XML JSON javacscript AJAX .

, mySQL .

+1

Source: https://habr.com/ru/post/1787933/


All Articles