I have a module that basically creates a contact form, and it works just fine. However, when I try to AJAX it (I’ve been doing AJAX for a year now, I’m quite sufficient) by submitting the data to the mod.contactmanager.php file of the module to the function accept_contact(), it brings up the following error:
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at …/domains/ideasandpixels.com/html/system/expressionengine/third_party/contactmanager/mod.contactmanager.php:134)
Filename: core/Common.php
Line Number: 417
Although it does return the messages I have set if the contact was missing fields and also displays the success message properly, this message is always right below it.
I am not displaying any data before this, nor calling any header-related functions. Looking in the Common.php file, I see it is setting some headers though. Any way around this?
I’m just doing a regular “echo” to return the messages, and I’ve tried JSONing the data (json_encode()) but that just messes it up even more.
Any ideas? Thanks!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.