We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29936
    • 1 Posts
    1. Создаю в сниппете php-скрипт.
    2. Вызываю сниппет в шаблоне.
    3. Сайт перестает работать, вместо этого выполняется этот скрипт (в данном случае информер), а ниже следующее:

    Warning: Cannot modify header information - headers already sent by (output started at /home/tib/site.ru/docs/manager/includes/document.parser.class.inc.php(771) : eval()’d code:2) in /home/tib/site.ru/docs/manager/includes/document.parser.class.inc.php on line 2625
    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
    Error: Cannot modify header information - headers already sent by (output started at /home/tib/site.ru/docs/manager/includes/document.parser.class.inc.php(771) : eval()’d code:2)
    Error type/ Nr.: Warning - 2
    File: /home/tib/site.ru/docs/manager/includes/document.parser.class.inc.php
    Line: 469
    Line 469 source: header(’Content-Type: ’ . $type . ’; charset=’ . $this->config[’modx_charset’]);

    Parser timing
    MySQL: 0.0117 s (7 Requests)
    PHP: 0.3769 s
    Total: 0.3886 s

    В темах наподобие http://modxcms.com/forums/index.php/topic,18679.0.html ответа не нашел.

    В чем может быть проблема?
      • 1611
      • 591 Posts
      видимо ваш скрипт рассчитан на работу в одиночестве. т.к. сам посылает заголовки и формирует html страницу.
      попробуйте его переписать так, чтобы он просто выводил свой кусок html кода, чтобы вы могли его вставить в свою страницу.