G
G
Gohyt2018-08-22 13:16:59
PHP
Gohyt, 2018-08-22 13:16:59

How to send a response to a request from another site?

Hello. I have one problem, I'm not familiar with PHP, but I need to make a site that, upon request from another site, should return a json file, tell someone how to do this? Those. For example, if we make such a request: localhost/posts, then that json should be returned in response.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2018-08-22
@webinar

site to local

???
The question is terrible, nothing is clear, there is a guess: maybe you need
php.net/manual/ru/function.file-get-contents.php

S
Stalker_RED, 2018-08-22
@Stalker_RED

Just place a posts file with the content you want in document_root and set up the webserver to serve it. PHP is not needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question