Warning: Cannot modify header information - headers already sent by (output started

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Warning: Cannot modify header information - headers already sent by (output started

    Please fix my code MobileChat

    $status=file('../text/bannames.txt');
    for ($ri=0; $ri<count($status); $ri++)
    {
    $resultban=rtrim($status[$ri]);

    if($nimi=="$resultban"){$admin="5";}
    }
    if($admin=="5"){
    header ('Location: ../tools/yourbanned.php');}

    $status=file('../text/bootnames.txt');
    for ($ri=0; $ri<count($status); $ri++)
    {
    $resultboot=rtrim($status[$ri]);

    if($nimi=="$resultboot"){$admin="6";}
    }
    if($admin=="6"){
    header ('Location: ../tools/yourbooted.php?nimi=$nimi');}
    $status=file('../text/bannames.txt');
    for ($ri=0; $ri<count($status); $ri++)
    {


    $resultipban=rtrim($status[$ri]);

    if($nimi=="$resultipban"){$admin="8";}
    }
    if($admin=="8"){
    header ('Location: ../tools/yourbanned.php');}

  • #2
    There is missing code you are not showing which is where the problem is to.
    It could be as simple as a space before opening php:
    Code:
    [Space here]<?php
    or maybe you have opened html before the header is given:
    Code:
    <html>
    <?php 
    header ('Location: ../tools/yourbanned.php');
    ?>
    (header must come before all html)

    Comment


    • #3
      yes.. i've show the <?php end >? and no white space.. but still error header..

      Comment


      • #4
        Is there an included page? ..... or is this page included from a different page?

        Comment


        • #5
          Doesn't the error specify which line is having the error?

          Comment

          Working...
          X