I'm not sure if this is the right place to post this, but it pertains to Drupal's handling of PHP code in pages...
I'm having trouble with end of line characters in a php page - in php 5.1 they were parsed properly and created new lines in PHP's output to mail() but on a different (production) machine running php 5.2, the end of line/line feeds don't get parsed, the slashes "\" are stripped and the "n" and "r" are sent as part of the output to mail.
here's the offending code:
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= 'From: <wishlist_request@djhicksantiquefurniture.co.uk>' . "\r\n";
mail($address,"Wishlist request from the website",$mailOut, $headers);
Instead of getting an html email it outputs "MIME-Version: 1.0rnContent-type:text/html;charset=iso-8859-1rnFrom:
rn"
so the end of line feeds aren't getting parsed. Is this a drupal issue, or a php one?
Help greatly appriciated!
CalonDdraig
Comments
Not sure
This could be an issue with the php filter OR other filters if you have them turned with the php filter. Have you tried running your code in a standalone php file to make sure it is not a server or php issue?
Hi, thanks for responding!
Hi, thanks for responding! It must be a filter issue, as when executed as a standalone script it works fine. Also, when I edit the page with the php code in it, the end of lines lose their slashes, so "\r\n" turns to "rn". I've only got the default Drupal 5 filters, and the page is set to "PHP Code" as a filter. It's an exact same copy of the website I was running under php 5.1 so I have no idea why it's messing up the end of lines.
Any ideas?