PHP Execute External File -


I have a file located on my server and I want to access that file remotely from another server And from the other PHP file located on the other server I want to execute the file's source code.

I have clicked on a file file_get_contentsâ €? However it only receives content displayed by that PHP file, as can be seen below.

So it is possible for a PHP file from an external file to execute the command on the server and the external server so that it can read the source code of the PHP file?

You can use an extension other than .php to retrieve the source For file_get_contents (or similar) use.

Not using PHP Extension will prevent PHP from parsing it as code, and instead it will be sent as text.

However, this will make any possible person navigating to a file in a browser as well as potentially major vulnerabilities. You should see why this is necessary and if it can be avoided in some way (possibly calling the file with the standards received or posted on other servers).

Comments