Saturday, 30 March 2013

Solution: PHP setcookie Warning: Cannot modify header information - headers already sent

Solution: PHP setcookie Warning: Cannot modify header information - headers already sent to avoid this problem add ob_start() at beginning of php and add ob_end_flush() at end of php code like below


<?php
    ob_start(); // Initiate the output buffer

//your code

    ob_end_flush(); // Flush the output from the buffer
?>

Share This!



No comments:

Post a Comment

Here We Write The Problems we face at different situations and Solutions to those problems.