Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > note 71366 added to function.header
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 23rd December 17:56
h0mer@osu1.php.net
External User
 
Posts: 1
Default note 71366 added to function.header


I think this might be useful for other people, because i searched nearly the whole web for it

If you need to create your own header and want to send text from a textfield with multiple lines (\r\n - Return), you will notice, that after the first \r\n (Return) your data will be truncated.

To solve this "problem" you need to replace the \r\n in the submitted string with %0D%0A.

<?php
$formatted_string = preg_replace('/(\r\n)/', '%0D%0A', $unformatted_string);
?>

I hope this will help others to avoid hours of searching .

With kind regards
H0MER
----
Server IP: 195.221.21.36
Probable Submitter: 57.66.193.71
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- https://master.php.net/note/edit/71366
Del: integrated -- https://master.php.net/note/delete/71366/integrated
Del: useless -- https://master.php.net/note/delete/71366/useless
Del: bad code -- https://master.php.net/note/delete/71366/bad+code
Del: spam -- https://master.php.net/note/delete/71366/spam
Del: non-english -- https://master.php.net/note/delete/71366/non-english
Del: in docs -- https://master.php.net/note/delete/71366/in+docs
Del: other reasons-- https://master.php.net/note/delete/71366
Reject -- https://master.php.net/note/reject/71366
Search -- https://master.php.net/manage/user-notes.php
  Reply With Quote


  sponsored links


2 8th June 09:23
tularis
External User
 
Posts: 1
Default note 71366 deleted from function.header by tularis


Note Submitter: H0MER

----

I think this might be useful for other people, because i searched nearly the whole web for it

If you need to create your own header and want to send text from a textfield with multiple lines (\r\n - Return), you will notice, that after the first \r\n (Return) your data will be truncated.

To solve this "problem" you need to replace the \r\n in the submitted string with %0D%0A.

<?php
$formatted_string = preg_replace('/(\r\n)/', '%0D%0A', $unformatted_string);
?>

I hope this will help others to avoid hours of searching .

With kind regards
H0MER
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666