Support » Fixing WordPress » Putting text in a file in wordpress

  • I just finished up redoing a plug-in which allows for storage of PayPal IPN data into a database table. I even have the plug-in mailing out IPN data correctly, no errors or warnings etc. Program is functional in all ways, except for the “backup” (or debug) text file I created to hang in the plug-in directory folder. Although the IPN data does file in the log file, the action always throws an warning error – [10-May-2010 18:53:54] PHP Warning: Cannot modify header information – headers already sent by (output started at … /logitfile.txt:4) in etc, etc.
    I had to move along and get this plug-in working for the client but this warning stuff nags on me.
    The error message occurs for every single insertion to the file. There are no blank spaces or lines in the php page(s) or the wp-config.php. I’ve gone thru various xxx_encode() concepts, header content-type concepts (as it works with the email) and all the possible combinations of fopen/fclose and file_put_contents I can imagine. The days spent searching and experimenting on this warning have been fruitless. Does anybody have the “definitive” work around to write to a text file in WordPress (not as a function call) like standard PHP 4 or 5 calls for?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Guess this remains a mystery of the ages.

    So the ongoing question will be:

    What has happened in the wordpress code that precludes the standard php 5 treatment for this matter?

    Have a somewhat type of conclusion to this. There can not be any referencing to any other part of the blog directory – the log file must go into the same directory as the plugin. End of Line.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Putting text in a file in wordpress’ is closed to new replies.