Jump to content

cristian77

Members
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

cristian77's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. <? $dirname = uniqid(); mkdir($dirname); copy('matrice.txt', $dirname.'/newfile.txt'); echo('done'); ?> Am rezolvat, functioneaza! Multumesc.
  2. Functioneaza, multumesc frumos! problema este ca orice as pune in continuare spre exemplu echo('done'); Imi da asa: Parse error: syntax error, unexpected 'echo' (T_ECHO) in C:\xampp\htdocs\test.php on line 6 Iar codul simplu pus in test.php vine cu eroarea: Notice: Use of undefined constant - assumed ' ' in C:\xampp\htdocs\test.php on line 6 Cu toate ca el lucreaza.
  3. Daca folosesc linia $newFileName = $dirname.'/newfile.txt'; Primesc eroare: Notice: Undefined variable: dirname in C:\xampp\htdocs\test1.php on line 6 Am incercat deasemenea varianta de mai jos aceeasi poveste: <? $dirname = uniqid(); mkdir($dirname); copy('contentfile.txt', '/'.$dirname.'/newfile.txt'); ?>
  4. Salut, Am nevoie de putin ajutor in codul de mai jos. Vreau sa citesc continutul unui fisier si sa il copiez intr-un fisier creat nou dintr-un random directory: <?php error_reporting(E_ALL); $dirname = uniqid(); mkdir($dirname); $newFileName = '/'.$dirname.'/newfile.txt'; $newFileContent = 'someinfofile.txt'; if (file_put_contents($newFileName, $newFileContent) !== false) { echo "File created (" . basename($newFileName) . ")"; } else { echo "Cannot create file (" . basename($newFileName) . ")"; } ?> Primesc eroare ca nu exista fisierul in directorul respectiv..
×
×
  • Create New...