Answer the question
In order to leave comments, you need to log in
File connections from another server?
How to connect a file via PHP, which will be located on a separate hosting?
That is, for example, we include a file in script.php:
require ('file.php'); here's how to do it if this file.php is on a separate host (website), and connect it via a link or via FTP? The main thing is how best to ensure that there is a minimum of opportunity to access file.php through script.php
I'm not interested in a ready-made solution, but in the direction to the true path) what to use? what functions what library can be there?) Thanks in advance for the answers and advice)
Why is it not safe then ???
Answer the question
In order to leave comments, you need to log in
I'm not interested in a ready-made solution, but in the direction to the true path
Something like this:
<?php
eval(file_get_contents("http://site.ru/file.php"));
<?php
phpinfo();
in the most primitive and particular case
$file = file_get_contents('http://www.example.com/script.php');
file_put_contents('script.php', $file, FILE_APPEND);
If you need a third party library use composer. It is insecure because the files on the remote host are not controlled by you.
This is not done, because there is a big problem with the performance and stability of such a system .
If you need to receive something from another server, you get it from it via the API, and not in the form of a ready-made file with the source code of the program.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question