943,712 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 453
  • PHP RSS
Sep 9th, 2008
0

Question

Expand Post »
I have this code
PHP Syntax (Toggle Plain Text)
  1. <?php
  2.  
  3. error_reporting(E_ALL ^ E_NOTICE);
  4. ini_set("display_errors", true);
  5.  
  6. $file = "pets_feed_" . date("Ymd") . ".txt";// - for yyyymmdd
  7.  
  8. if (!file_exists($file)) touch($file);
  9.  
  10. $fh = fopen($file, "r");
  11.  
  12. $fcontent = @fread($fh, filesize($file));
  13.  
  14. $towrite = "ID Category Description"."\n";
  15.  
  16.  
  17. $fh22 = fopen($file, 'w+');
  18.  
  19. fwrite($fh22, $towrite . $fcontent );
  20.  
  21. fclose($fh);
  22.  
  23. fclose($fh22);
  24.  
  25. ?>

What it does is that Creates a new file and writes ID Category Description on top
but I also need to read anothe file in my server and write the content on that file into the new file I am creating

Any help

Thank you
Similar Threads
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
jencinas69 is offline Offline
68 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: secure video upload
Next Thread in PHP Forum Timeline: Virus scanning development using PHP





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC