A
A
ambal2452020-08-28 09:18:34
PHP
ambal245, 2020-08-28 09:18:34

How to get JSON sent from a site and send to another via curl?

The crux of the matter is as follows. From different sites, after posting comments and installing my code, Json is sent by the POST method via curl where the secret key is passed.

How can I make this JSON come to my server, add a secret key to the received JSON and send it also using the POST method via curl or the command file_get_contents($url . 'received json');
After the successful sending of the data, a mark will be entered in the database that the data has been sent, to view the statistics of the resent data.

Tell me in which direction to move?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
FanatPHP, 2020-08-28
@ambal245

Some strange question. You seem to have described everything as it should work. what exactly do you not understand? How to accept a post request on the site? Seriously?
How to make a note in the database?
How to decode jason, add element to array and encode back?
How to send data by curl? There is not a single example on the Internet?
If none of the above, then you need to buy a textbook and sit down to learn PHP.

A
Alexander Latukhin, 2020-08-28
@aleksandr97

You can look in the direction of http callback, you will receive an http request in the query parameters there will be some link to which you will need to send the data after modifying them

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question