CODE
<?
if($_SERVER['REQUEST_URI']=='/index.php?pg=manage'&&$ahop['id']==1){
$ftp_server="********";
$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
$ftp_user='********';
if (@ftp_login($conn_id, $ftp_user, '*******')) {
echo "Connected as $ftp_user@$ftp_server<br /><br />\n";
$mode = ftp_pasv($conn_id, TRUE);
ftp_chdir($conn_id, "public_html");
$file_list = ftp_nlist($conn_id, "");
foreach ($file_list as $file){
if(is_file($file)&&$file!="google6853f2b77ebc7469.html"&&$file!=".htaccess"){
$local="C:/ftp".$file;
if (ftp_get($conn_id, $local, $file, FTP_ASCII)) {
echo "Successfully written to ".$file."<br />";
}
else {
echo "There was a problem\n";
}
}
}
}
else {
echo "Couldn't connect as $ftp_user\n";
}
ftp_close($conn_id);
}
else{
echo "Stop snooping. You are not supposed to be able to access this.";
}
?>
if($_SERVER['REQUEST_URI']=='/index.php?pg=manage'&&$ahop['id']==1){
$ftp_server="********";
$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
$ftp_user='********';
if (@ftp_login($conn_id, $ftp_user, '*******')) {
echo "Connected as $ftp_user@$ftp_server<br /><br />\n";
$mode = ftp_pasv($conn_id, TRUE);
ftp_chdir($conn_id, "public_html");
$file_list = ftp_nlist($conn_id, "");
foreach ($file_list as $file){
if(is_file($file)&&$file!="google6853f2b77ebc7469.html"&&$file!=".htaccess"){
$local="C:/ftp".$file;
if (ftp_get($conn_id, $local, $file, FTP_ASCII)) {
echo "Successfully written to ".$file."<br />";
}
else {
echo "There was a problem\n";
}
}
}
}
else {
echo "Couldn't connect as $ftp_user\n";
}
ftp_close($conn_id);
}
else{
echo "Stop snooping. You are not supposed to be able to access this.";
}
?>
When I run this the error I get is:
CODE
Warning: ftp_get(): Error opening C:/ftp in /home/shmohel/public_html/manage.php on line 14
let me know if you ahve any ideas.
