0

I have an application which has the following structure on the user/frontend side:

usercontroller: generates output
userformhandler: processes user input and redirects back to usercontroller

So, when the user inputs data the following type of URL is called:

http://localhost/wordpress/?page_id=4&ftype=userform&func=edit&noheader=true

In this model, the userformhandler processes the data, saves it and then redirects back to the usercontroller. On the admin side (which calls ftype=adminform) this works fine. On the user side however, I get the following error:

WARNING: CANNOT MODIFY HEADER INFORMATION - HEADERS ALREADY SENT BY 
(OUTPUT STARTED AT /VAR/WWW/HTML//WORDPRESS/WP-INCLUDES/L10N.PHP:156) 
IN /VAR/WWW/HTML/WORDPRESS/WP-INCLUDES/PLUGGABLE.PHP ON LINE 881

The headers are being sent from the search box of the twentyeleven theme. Some investigation leads me to believe that the noheader parameter is only honored in ./wp-admin/admin.php ...

Seeing this, is there any way to do this type of processing on the user side without generating headers, ie: do some processing which does not generate output and redirect back to another controller on the user side?

Greetings/Thanks

0

You should be sending your header(s)/processing the request before the template loads.

In fact, a hook was added specifically for this: template_redirect

  • @user13955 Please don’t forget to mark this answer as the answer (the checkmark on the left ✔). – fuxia Jul 11 '12 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.