За последние 24 часа нас посетили 17676 программистов и 1658 роботов. Сейчас ищет 881 программист ...

Cannot modify header information ... и тд

Тема в разделе "Прочие вопросы по PHP", создана пользователем zhenia3003, 2 янв 2013.

  1. zhenia3003

    zhenia3003 Активный пользователь

    С нами с:
    20 авг 2012
    Сообщения:
    184
    Симпатии:
    3
    Внезапно появилась следующая ошибка:

    Warning: Cannot modify header information - headers already sent by (output started at /home/u622371501/public_html/up.php:6) in /home/u622371501/public_html/un_up.php on line 15

    кусок index.php :
    Код (Text):
    1.  
    2. <?
    3. require 'up.php';
    4. ?>
    5. <?
    6. require 'un_up.php';
    7. ?>
    8. <table class="main_cont" border="0">
    9. <tr>
    10. <td class="l_cont">
    up.php :
    Код (Text):
    1.  
    2. <html>
    3. <title>заголовок</title>
    4. <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
    5. <META Name="revisit-after" Content="1 days">
    6. <meta name="description" content="текст">
    7. <meta name="keywords" content="текст">
    8. <link rel="shortcut icon" href="main/faviconka.ico" type="image/x-icon">
    9. <link rel="stylesheet" type="text/css" media="all" href="main/style.css">
    10. <body>
    11. <div class="white_sh">
    12. <div style="position:absolute; width:900px;margin-left:-450px;left:50%; top:49px;text-align:center;padding-left:1px;">
    13. <h1>• текст • текст • текст • текст  • текст •</h1>
    14. </div>
    15. <div class="logo"></div>
    16. <div class="scis1"></div>
    17. <div class="up_line"></div>
    18. <div class="buttons" oncontextmenu="return false;">
    19. <a id="but" href="index.php">главная</a><a id="but" href="1.php">11111</a><a id="but" name="button" href="2.php">22222</a><a id="but" href="about.php">3333333</a><a id="but" href="blog.php">444444</a></div>
    un_up.php :
    Код (Text):
    1.  
    2. <div class="buttons">
    3. <form method="post">
    4. <input class="m_but" name="1" type="submit" value="текст">
    5. <input class="m_but" name="2" type="submit" value="текст">  
    6. <input class="m_but" name="3" type="submit" value="текст">
    7. <input class="m_but" name="4" type="submit" value="текст">
    8. <input class="m_but" name="5" type="submit" value="текст">
    9. <input class="m_but" name="6" type="submit" value="текст">
    10. <input class="m_but" name="7" type="submit" value="текст">
    11. <input class="m_but" name="8" type="submit" value="текст">
    12. </form>
    13. </div>
    14. <?
    15. if($_POST["1"]==true){
    16. header("Location:i_1.php");
    17. } else if($_POST["2"]==true){
    18. header("Location:i_2.php");
    19. } else if($_POST["3"]==true){
    20. header("Location:i_3.php");
    21. } else if($_POST["4"]==true){
    22. header("Location:i_4.php");
    23. } else if($_POST["5"]==true){
    24. header("Location:i_5.php");
    25. } else if($_POST["6"]==true){
    26. header("Location:i_6.php");
    27. } else if($_POST["7"]==true){
    28. header("Location:i_7.php");
    29. } else if($_POST["8"]==true){
    30. header("Location:i_8.php");
    31. }
    32. ?>
    Добавлено спустя 1 минуту 21 секунду:
    заголовки выводятся в файле up.php , если не выводить up.php, то уже ругается на index.php
     
  2. igordata

    igordata Суперстар
    Команда форума Модератор

    С нами с:
    18 мар 2010
    Сообщения:
    32.408
    Симпатии:
    1.768
    output started at /home/u622371501/public_html/up.php:6

    Добавлено спустя 56 секунд:
    ob_start() поможет