Code: Select all
Warning: fopen(/hsphere/local/home/sadmi/site.com/test/text.txt): failed to open stream: Permission denied in /hsphere/local/home/sadmi/site.com/test/test1.php on line 7
Warning: ftp_fget() expects parameter 2 to be resource, string given in /hsphere/local/home/sadmi/site.com/test/test1.php on line 12Code: Select all
1 <?php
2
3
4
5 $filelocation = $_SERVER['DOCUMENT_ROOT'] . '/test/' . 'text.txt';
6 $source = "http://www.site.com/test/test1.txt";
7 $target = fopen("$filelocation", "w");
8
9 $conn = ftp_connect("site.com") or die("Could not connect");
10 ftp_login($conn,"login","password");
11
12 ftp_fget($conn,$source,$target,FTP_ASCII);
13
14 ftp_close($conn);
?>thanks in advance
ziggy