I've been chasing my tail with the best way forward regarding the following problem. Please feel free to comment.
Basically I wish to read the contents of a remote file. The file type will be php, or HTML, but sits above the remote servers webserver. Therefore I cannot use a HTTP request as I need to pass the absolute path.
An example being the remote file sits on usr/files/somefile.php on server 184.108.40.206.
How would you suggest I connect to 220.127.116.11 then read the contents of the file usr/files/somefile.php? Please be aware I do have access to cURL, but am not 100% up to speed with the FTP side of the package.
The file that you want to read must was not disabled by admin host [ex: .htaccess file ].
I have two solution for u:
1 -> use Ajax with get method to get content its.
2. Use php function to do that.
With solution second you can read php manual or search in google for this problem .
file_get_content('path to file');
file_open("path to file ", "rb"); [ notice: two method for this function : http and ftp ]
If the file is not directly available via HTTP, AJAX or any other browser request (besides FTP), would not do any good. Using PHP's builtin FTP system is a little easier than doing it through the CUrl extension.
There are only two other possibilities. One is to use SCP or sftp with the SSH2 extension. The other is to have a password protected, HTTP accessible PHP script on the remote machine that can use file functions to retrieve the file for you.