our problem is " Cannot modify header information - headers already sent "?
Is anyone know about this problem that why this happen?

Recommended Answers

All 2 Replies

It generally happens when you output something before the header() function, for example:

<?php

    echo 'hey!';
    header('Location: /');

You should write your script to avoid these situations or, if you can modify your php.ini, then you can change the output_buffering directive to 4096 or to On, for more information check this:

It is an error in your code, as cereal shows
can be as simple as including an extra space where there shouldnt be one, before the opening <?php
that space is output to the browser and no headers can be sent
If you cannot locate it post the code and others will point out the fault,

its easy to see other's errors,
impossible to see your own. . . . . other peoples errors are more fun

if you do not have access to your php.ini file, many hosts do not permit it
file buffering can be enabled within the file, (in this case compression as well)

<?php ob_start("ob_gzhandler"); ?>
<!DOCTYPE html>
<html lang="en" xml:lang="en">
<head>
</head>
<body>
</body>
<script src='/js/bootstrap.min.js.php'></script>
</html>
<?php ob_flush(); ?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.