SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist spinmaster's Avatar
    Join Date
    Mar 2005
    Posts
    456
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry QuickForm_Controller - "headers already sent by..." problem

    Hi,

    I've been running in a problem using PEAR::HTML_QuickForm_Controller which is giving me kind of a headache

    my QuickForm_Controller code for generating the form-pages is below an include file for a HTML header (which includes the DB-connection, etc.):

    PHP Code:
    require_once ('header.inc.php'); 

    ... 
    QuickForm_Controller Code ...

    require_once (
    'footer.inc.php'); 
    running the page once is fine, however as soon as one clicks on the 'next-button' and the second page is processed via $this->setDefaultAction('next'); , the script terminates with a

    Warning: Cannot modify header information - headers already sent by (output started at /srv/www/htdocs//public/header.inc.php:8) in /usr/share/php/HTML/QuickForm/Action/Jump.php on line 53

    I checked the Jump.php and its using a header('Location: ' . $url);

    I assume my header-include file is the problem as it creates obviously HTML output, but I don't really know a workaround right now to fix the problem with the Controller Jump class...

    anyone here who had a similar problem or who has a suggestion how to fix this??

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could always buffer your output with ob_start().
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Evangelist spinmaster's Avatar
    Join Date
    Mar 2005
    Posts
    456
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo
    You could always buffer your output with ob_start().
    thx... but I'm sure there is another workaround... I'd love to hear from other users how they use the Controller with a Header or some other kind of HTML code just before the Controller code...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •