Jump to content

[SOLVED] two headers problem


shadiadiph

Recommended Posts

Hi the guys who host my sites thoughtfully upgraded to php 5 recently and I am having alot of problems with passing variables etc seems alot stricter now.

 

I keep getting the error

 

 

Warning: Header may not contain more than a single header, new line detected.

 

 

my code works fine or rather used to I have a message page which goes to a submit page if the validation number correct it submits fine if the validation number is incorrect it directs back to the message page conatining all the variables in the url fid=$firstname&lid= etc that were submitted which can be retrieved by $_GET. The problem i am having is with the $message that was sent if it is only one line directs back to the message page fine but as soon as someone puts a line break in the message and submits I get the above error has anyone found a fix for this? i tried using nl2br with or without it has the same problem i have also tried

 

$message = ereg_replace( ' +', '%20', $message);

 

before inserting it in the url to redirect back but seems to make no difference at first i thought the error meant i had two headers on the page and it was not allowed but that isn't the case that would be crazy right most pages have an if else statement i am thinking new line means a line break which would be in the $message anyway I am going to stop babbling and wait for a reply thanks.

Link to comment
https://forums.phpfreaks.com/topic/165772-solved-two-headers-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.