Jump to content

Header failing with GET


brad_langdon

Recommended Posts

Firstly the code with the issue is as follows...

 

header( "Location:../index.php?validate=failed" ."&name=$name"."&phone=$phone" ."&email=$email" ."&enquiry=$enquiry"  );

 

It works fine unless the last variable ( $enquiry ) has more than one line of text.

If the user only types one line of text into the enquiry field it works fine but as soon as they have a line break by pressing enter I get the following error...

 

Warning: Header may not contain more than a single header, new line detected. in /home/brad_langdon/vander.co.nz/HeatPump/inserts/sendmail.php on line 52

 

Please Note: I am using POST to get the form data to the processing page. I am just using GET to get the data back to the form page if it does not validate so that the user does not have to re enter everything.

 

Also the problem is not having more than one variable in the header as I have checked this.

 

Thanks to anyone in advance who can help  :o

Link to comment
https://forums.phpfreaks.com/topic/168068-header-failing-with-get/
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.