Jump to content

cabaldemon

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cabaldemon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. can anyone help with that because i still cannot fix this thank you
  2. ok i finally got it to write to a file by setting the absolute path where the directory is but now it writes the exact path instead of the file
  3. can someone please help please i still cannot get this code to make it write to a file from read of directory files thank you in advance
  4. yes soz i forgot to write the begining <?php and $stringdata shouldnt have been in there i tried your code and it still wont write to a file i cant figure it out
  5. i can get it to work on a web page but i cant get it to copy to a file
  6. thank you for that answer i am on a windows machine because of the kinda servers i host but does that code look ok cause i cant get it to work
  7. i have a code that reads from a directory and echose the directory out to the php web page.what it wont do is write to a file so that a music player or my other a video player can read from this code is to write to the file // directory path can be either absolute or relative $dirPath = 'music/.'; $myFile = "music.m3u"; $stringData = "$file"; // open the specified directory and check if it's opened successfully if ($handle = opendir($dirPath)) { // keep reading the directory entries 'til the end while (false !== ($file = readdir($handle))) // just skip the reference to current and parent directory if ($file != "." && $file != "..") { if (is_dir("$dirPath/$file")) { // found a directory, do something with it? $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, $stringData); fclose($fh); } } // ALWAYS remember to close what you opened closedir($handle); } ?> can anyone help thank you
×
×
  • 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.