Jump to content

grilo

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by grilo

  1. Hey litebearer... Thanks for the quick reply.... I already tried almost every solution i found on web, but the problem is residing on copying files from admin folder in server to new dir created by user, i tried to add this two separate actions 1. create new dir $newdirname input by user and 2. copy files from admin to new dir. First - success in creating new dir by user input Second - failure in copying files. $source = 'admin'; $destination = $newdirname."/".$source; copy($source, $destination); and then the copy function.... Al the files are chmod 0777, but still no progress... Can you help?
  2. Please can anyone assist me on this matter and tell me what am i doing wrong? I need to copy directory contents from "admin" folder to new created one. <?php $newdirname = $_POST['Username']; if(file_exists($newdirname)) { print "&error_=Restaurante já existente.&"; }else{ $old = umask(0); mkdir($newdirname,0777); umask($old); echo"&error_=Obrigado - Restaurante adicionado com sucesso&"; $source = 'admin'; $destination = $newdirname."/".$source; copy($source, $destination); function copy_directory( $source, $destination ) { if ( is_dir( $source ) ) { @mkdir( $destination ); $directory = dir( $source ); while ( FALSE !== ( $readdirectory = $directory->read() ) ) { if ( $readdirectory == '.' || $readdirectory == '..' ) { continue; } $PathDir = $source . '/' . $readdirectory; if ( is_dir( $PathDir ) ) { copy_directory( $PathDir, $destination . '/' . $readdirectory ); continue; } copy( $PathDir, $destination . '/' . $readdirectory ); } $directory->close(); }else { copy( $source, $destination ); } } } ?> I need urgent help! Thanks
  3. Dear sirs. I´m new here and in php coding, after searching i found a php code that suits my needs. Creats a dir, and copy.zip file to new dir. - OK! Now i cant seem to be doing things right because i tried almost everything and can´t make it run. Here´s the code: <?php $newdirname = $_POST['Username']; if(file_exists($newdirname)) { print "&error_=Restaurante já existente.&"; }else{ $old = umask(0); mkdir($newdirname,0777); umask($old); echo"&error_=Obrigado - Restaurante adicionado com sucesso&"; $file = 'gdr_servidor.zip' ; $newfile = $newdirname."/".$file; chmod("gdr_servidor.zip", 0777); if (!copy($file, $newfile)) { echo "&error_=failed to copy $file"; //function extract_zip_file(){ // $zip = new ZipArchive; // $res = $zip->open('gdr_servidor.zip'); // This line // if ($res === TRUE) { // $zip->extractTo($newdirname); // This line // $zip->close(); // echo 'ok'; // This line // } else { // echo 'failed'; // This line // } //} $dir = opendir($newdirname); while(false !==($file=readdir($dir))){ if(strpos($file, '.zip',1)){ extractupdate($file); } } function extractupdate($file){ $zip=new ZipArchive; if($zip->open('temp/'.$file) == TRUE){ $update=rtrim($file, ".zip"); $zip->extractTo($newdirname); $zip->close(); echo "Extraction started."; } else { echo "Failed to start extraction."; } } function installupdate($update){ } } } ?> Can you assist me? I think it must be the chmod of the copied file to $newdirname... :-\ Thanks!!!
  4. Dear sirs... I´m sorry for asking but can you assist me? This php script is exactly what i was looking for, but it dosen´t work for me rather then creating a file "folders" Here´s error report: "Notice: Undefined index: folderName in /hsphere/local/home/gdr2010/webrestaurante.info/teste/teste/teste4.php on line 7 Folder folders/ has been created." How can i define the index folder? Thanks for the reply and sorry for the trouble.
  5. Hy Maq. No it will be to use with flash. (swishmax actually) and already on-line... Thanks
  6. Dear Sirs. I´m in need of some light in PHP. And sorry for the trouble... i´m a newby I need to create a folder, rename it and then after conclusion copy files from one directory to recent created one. Can any one assist me on this matter? Thanks very much.. and sorry for the trouble
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.