web directoryearn money in seconds   Free file hosting, free video sharing

<<< The Web Hosting >>>


Go Back   Noeman GSM > Webhosting & Website development > Website development > Programming

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-13-2007, 05:15 PM
Spiral's Avatar
CO-Admin
 
Join Date: Sep 2004
Location: Martil
Age: 25
Posts: 15,830
Reputation: 20008
Spiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super MemberSpiral Mega Super Member
Default Copying files from another server

This script will allow you to copy files from other server that you own. You only need to specify the ftp host, ftp user name, ftp password, and the folder where the files to be copied are stored. You need to upload this script in the folder where you want to transfer the files. Be sure that the folder where you want to transfer the files is in chmod 777.


PHP Code:
<?
$HOST
=”domain.com”//change domain.com with your ftp host
$UN=”username”//ftp user name
$PW=”pass”//ftp password
$DIR=”www/location///location of files you want to copy

$conn ftp_connect($HOST);
if(!
$conn) {
exit(
”Could not connect to server$HOSTn”);
}else{
echo 
“connected”;
}

//exit;
if(!ftp_login($conn,$UN,$PW)) {

ftp_quit($conn);
exit(
”Could not log inn”);
}

echo 
“current directory is ” .ftp_pwd($conn);

ftp_chdir($conn,$DIR);

echo 
<p>Now the current directory is ” .ftp_pwd($conn);

$files ftp_nlist($conn,.);

for(
$i=0;$i<count($files);$i++) {
echo 
“Saving $files[$i] <br>;

if(!
ftp_get($conn,$files[$i],$files[$i],FTP_BINARY)) {
echo 
“Could not download {$files[$i]}n”;
}
}

ftp_quit($conn);
?>
Reply With Quote
Sponsored Links
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 08:16 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 2004-2008 Noeman . All rights reserved
Loans | Credit Card Consolidation | Credit Card Consolidation | Refinance | Credit Cards

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112