The following warnings occurred: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
|
Headers already sent in plugin functions - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16) +--- Thread: Headers already sent in plugin functions (/showthread.php?tid=2757) |
Headers already sent in plugin functions - Zorato - 2012-02-14 First, I've installed pure GS 3.1 r646, w/o any plugins. The only change I made - enabled GSDEBUG in gsconfig.php. Second, I've created simple plugin, with 1 line of code: Code: <?php The problem is, that I use header() function within my plugins on hosting with PHP 5.2.17 (IMHO, with any PHP >5.2 and <5.3) I've got this: Quote:Warning: Cannot modify header information - headers already sent by (output started at /var/www/user21243/data/www/~/pure/admin/inc/template_functions.php:27) in /var/www/user21243/data/www/~/pure/plugins/someplugin.php on line 25Any ideas? As a temporary solution I use redirect($url) function from basic.php file, but it causes double page refresh and it is not very comfortable to work like that. I sniffed around, but didn't find any functions in load.php, common.php or template_functions.php that may work differently in PHP 5.3 and PHP 5.2 Headers already sent in plugin functions - n00dles101 - 2012-02-14 try taking away the ending ?> might be some extra whitespace after the end tag... its ok to leave it out... (something I didn't know till I joined up here.. 8) Headers already sent in plugin functions - Zorato - 2012-02-14 Nope, didn't help. The most strange thing is, that this code works 'as it is' on host with PHP 5.3+ and didn't work with PHP 5.2 (windows or linux doesn't matter) Headers already sent in plugin functions - mvlcek - 2012-02-14 The only way to output a HTTP header reliably in the backend is in the admin-pre-header action - and it only exists in GetSimple 3.1. In all other actions and filters some HTML has already been output and you will get this error message. The only way it would work is if output buffering is turned on in your PHP installation - maybe this is the default for PHP 5.3+ or at least your installations. Headers already sent in plugin functions - Zorato - 2012-02-14 mvlcek Wrote:The only way to output a HTTP header reliably in the backend is in the admin-pre-header action - and it only exists in GetSimple 3.1.Thanks, will try to add another action for plugin to implement that hook. By the way, I've written plugin for personal use, that didn't store config and logs in XML files (.txt instead). I'm thinking about sharing it by uploading to Extend section. Should I re-write code for XML files due to GS ideology or I can post it without any restrictions even if doesn't use XML? |