DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   PHP (http://www.daniweb.com/forums/forum17.html)
-   -   fwrite not working with ob_start, Any ideas? (http://www.daniweb.com/forums/thread158602.html)

digital-ether Nov 21st, 2008 11:25 am
Re: fwrite not working with ob_start, Any ideas?
 
Quote:

Originally Posted by rickya100 (Post 741320)
As much as I can tell it is. The file is being written when output buffering is not on. So I would assume that that means that the directory is OK.

I'm developing locally on a Mac (the folder properties show it not locked and that read & write is allowed) is there any way that could be causing a problem?

If not I'll keep working on it and if I get it I'll make sure to post up the fix.

Thanks again for the help. Really appreciate it.


Richard

Do you sure PHP is displaying errors?

The only thing I can think of is if you have an error occurring in the output buffering part of the code, and it's stopping code execution from moving on to the file writing portion.

Make sure you have error reporting on.

ini_set('error_reporting', E_ALL);
ini_set('display_errors', '1');

See if you get errors.

ps: a shortcut for:

$data = ob_get_contents();
        ob_end_clean();

is
$data = ob_get_clean();


All times are GMT -4. The time now is 2:18 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC