Hi,

I have a php script that runs on serverX(Reader Server) to read files that are in serverY(Source Server) to copy them one by one into a particular folder in serverX(Reader Server).

Reader Server:
host: 192.168.10.1
uid: root
psw: 123123
whereToCopy: /var/www/html/store_here

Source Server:
host: 192.168.10.2
uid: root
psw: 123123
pathToFiles: /var/www/vhost/pictures_are_here

What this line should be to copy from Source server into Reader server?

php copynow.php ............ ........... .........

copynow.php is based in Reader server.

Thanks in advance

I need right syntax for $pathToImages variable. Array is empty when I run it.

$pathToImages = "root:123123@192.168.10.02:22 /var/www/vhosts/pictures/";

if($handle = opendir($pathToImages)){
	while(false !== ($file = readdir($handle))){
		if($file != "." && $file != ".."){
			$file[] = str_replace(" ", "", $file);
		}
	}
	
	closedir($handle);
}

echo "<pre>";
print_r($file);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.