Disappearing EOL...can you solve the mystery?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
SorryDev
Forum Newbie
Posts: 7
Joined: Fri Sep 08, 2006 3:49 pm

Disappearing EOL...can you solve the mystery?

Post by SorryDev »

I have this PHP code:

Code: Select all

<p>
            Your request was invalid.<br />
            The following error was reported: "<?php echo $errorMessage; ?>"<br /><br />
            <?php echo $GLOBALS['baseName']; ?> @ <?php echo $GLOBALS['baseUri']; ?>
        </p>
When interpreted by the Web server, I get the following output:

Code: Select all

<p>
            Your request was invalid.<br />
            The following error was reported: "Invalid request. (missing or empty uuid)"<br /><br />
            Blah blah @ Blah blah        </p>
Question:

Why did the EOL/LF after

Code: Select all

<?php echo $GLOBALS['baseUri']; ?>
get zapped?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

PHP automatically removes a trailing carriage return.
SorryDev
Forum Newbie
Posts: 7
Joined: Fri Sep 08, 2006 3:49 pm

Post by SorryDev »

feyd wrote:PHP automatically removes a trailing carriage return.
Really?

Is that new in PHP 5 or was it always there?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Always been there as far as I can remember.
SorryDev
Forum Newbie
Posts: 7
Joined: Fri Sep 08, 2006 3:49 pm

Post by SorryDev »

feyd wrote:Always been there as far as I can remember.
Thanks for the tip!

Are you really Harkonnen? :D
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

SorryDev wrote:Are you really Harkonnen? :D
I've got the slaves to prove it. :)
SorryDev
Forum Newbie
Posts: 7
Joined: Fri Sep 08, 2006 3:49 pm

Post by SorryDev »

feyd wrote:
SorryDev wrote:Are you really Harkonnen? :D
I've got the slaves to prove it. :)
I ask because my usual forum name is DuneMessiah...
It would be the first time I get help from your kind. :D

Just kidding...thanks for the tip.
Post Reply