Using PHP to call a script to manipulate files or ssh?

You can use exec method php.net/manual/en/function.exec.php.

This is the way: stackoverflow.com/questions/717854/sftp-... use cURL from PHP to query the remove SFTP server, for both listing and file retrieval. Manual for php is here. You don't need any SSH scripts (which by the way is usually strictly forbidden on most shared hosting environment), if your sFTP server is publicly available.

Curl will do everything for you.

Sftp isn't supported. Curl sftp://user@host:22 curl: (1) Unsupported protocol: sftp – msandbot Jun 24 '10 at 12:26 i'm trying to get the IT guy to update curl, ssh2 also looks useful. Wish I had root access.

I tried exec('ssh blah blah') and that didn't work. Also tried exec('perl sample. Pl') where sample.Pl just has ssh blah blah blah I don't think that it even ran.

– msandbot Jun 24 '10 at 16:03 all functions like exec(), system(), etc. Are always restricted, and it's really a hard task to have them enabled by the IT departments, as they open the way to potentially deadly vulnerabilities. If you can get your curl to work that'll be the best solution! – Palantir Jun 28 '10 at 6:07.

In the selection box you can list the files with: if (is_dir($dir)) { if ($fh = opendir($dir)) { while (($file = readdir($fh))! == false) { if($file! = "." && $file!

= "..") $files = $file; } closedir($fh); } } to transfer the files from one to another host you can use php exec and scp: exec('scp host1:/path/to/oldfile host2:/path/to/newfile').

He's trying to get the list from a remote server, while these functions will work on local server only – Palantir Jun 24 '10 at 12:16 oh, you're right the first one only works local. He could but this php code on the sftp server though ;) the second code should be applicable – Oliver Jun 24 '10 at 12:23.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions