busboy — 2012-05-03T22:32:15-04:00 — #1
Here is the code I have at the top of my page:
$preventSpam = ob_get_clean();
Here is the code that I have towards the bottom of my page:
$pageIntro .= "<p>$formFirstName, thank you for registering. An email has been sent containing a confirmation link. Click on this link to finalize your registration. You will then be able to login and conduct keyword searches and post your own testimonials.</p>
<p>Sometimes legitimate email mistakingly gets flagged as spam by internet service providers. Take action now to ensure your confirmation email does not get filtered into your junk or bulk mail folder.</p>";
Here is the error I'm getting when the page is loaded:
Warning: Cannot modify header information - headers already sent by (output started at /home3/recordau/public_html/newVersion/register.php:876) in/home3/recordau/public_html/newVersion/startSession.php on line [B]4
What is the best way to display the contents of an include file since this doesn't seem to work?
starlion — 2012-05-04T08:22:33-04:00 — #2
Is there a particular reason you need to do all this instead of include'ing the file where you have the echo statement?
busboy — 2012-05-04T08:40:41-04:00 — #3
I tried that and got an error. You see, I need the contents of that external file to be added to the $pageIntro variable so later the whole thing can be displayed, like this:
$pageIntro .= " contents of the include file ";
What is the best way to do this?
starlion — 2012-05-04T08:42:43-04:00 — #4
does preventSpam.php actually include PHP code? Or is it just HTML?
busboy — 2012-05-04T08:52:34-04:00 — #5
starlion — 2012-05-04T08:56:10-04:00 — #6
file_get_contents it instead of including it.
tom8 — 2012-05-04T09:33:32-04:00 — #7
Also check to make sure there are no contents outputted before the header() is called.
busboy — 2012-05-06T21:24:50-04:00 — #8
Thank you, that did the trick brother!