How to access a directory in php present on a different server?

时间:2019-05-22 18:37:07

标签: php directory ftp opendir

I am working on a php code as shown below in which I want to scan a directory present on a different server. I have used PHP's FTP Capabilities to remotely connect to the server and get a directory listing. I have placed dummy details at this moment

<?php

$ftp_ip = '11.22.33.44';

$ftp_l = 'apc';

$ftp_p = 'def';

$conn_id = ftp_connect($ftp_ip);

$login_result = ftp_login($conn_id, 'abc', 'def'); 

$src_dir = ftp_nlist($conn_id, 'incoming_folder')   /* incoming_folder is present in 11.22.33.44 */

ftp_close($conn_id);

?>

Problem Statement:

I am wondering what changes I should make in the php code above so that I am successfully able to make a connection on a different server and scan the directory present there. With the current code above, the page doesn't load.

0 个答案:

没有答案