RE: [PHP-GENERAL] copying files

From: Date: Mon, 26 Jun 2000 19:03:01 +0000
Subject: RE: [PHP-GENERAL] copying files
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-3173@lists.php.net to get a copy of this message
Try one of these: copy($file, "$newdir/$domain/".$file); copy($file, $newdir."/".$domain."/".$file); copy($file, "$newdir/$domain/$file"); The latter is probably better. I don't think you can have spaces when you use the string concatenation operator. Jason > -----Original Message----- > From: Ken N [mailto:kenn@pcintelligent.com] > Sent: Monday, June 26, 2000 8:58 AM > To: php-general@lists.php.net > Subject: [PHP-GENERAL] copying files > > > Hi, > I have this little piece of code that seems to work fine except it > doesn't copy the file. Other than that I know it's getting the filenames > cause it prints the, out and it's not have trouble creating the directory > either. any suggestions? > > Thanks > //========================================= > <?php > echo("<B>" . "I am going to move $domain into $newdir" . > "</B>"); > mkdir("$newdir/$domain", 0770); > $directory = opendir("$dir/$domain"); > > while ($file = readdir($directory)) > { > if(($file != ".") && ($file != "..")) > { > copy($file, "$newdir/$domain/" . $file); > > echo("<B>" . "I moved $file into $newdir/$domain" . > "</B>" . "<BR>"); > } > } > > > http://cleveland.lug.net/~rocket/ > > The answer is simple if you grant that ironies are like submarines; > dangerous only when submerged. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > _______________________________________________________ Site Design, Hosting, and E-Commerce at www.webpipe.net

« previous php.general (#3173) next »