Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Php Escaped Control Characters And Windows, they aren't working for me.
jlhaslip
post Oct 15 2006, 07:26 AM
Post #1


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 4,083
Joined: 24-July 05
From: Linix, DOS and Windows…the good, the bad and the ugly
Member No.: 9,787
Spam Patrol



In php coding, when you escape certain characters, they have an impact on the output of an echo'd or printed string. ie "\r\n\t" should give you a new line and a tab before outputting the content for a line of printing. They vary by OS, I know, but I have tried all the variations I can think of and can't seem to control output using them.
Believe me, I have tried multiple variations and nothing works for me.

I have checked the php.ini file for settings but I can't find where you can modify them.

So the question is :

Where do i look to confirm the settings for using these Control Characters in the php parser or config files?

Anyone know? And thanks in advance.
Go to the top of the page
 
+Quote Post
Spectre
post Oct 15 2006, 02:15 PM
Post #2


Privileged Member
*********

Group: Members
Posts: 873
Joined: 30-July 04
Member No.: 246



What exactly are you trying to output, and what are you trying to view it in? A web browser simply ignores newlines for formatting in an HTML document, generally treating them simply as a space. Try setting the Content-Type header to text/plain or using the preformatted tag (<pre>), or just add a '<br>' to your string.
Go to the top of the page
 
+Quote Post
jlhaslip
post Oct 15 2006, 04:49 PM
Post #3


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 4,083
Joined: 24-July 05
From: Linix, DOS and Windows…the good, the bad and the ugly
Member No.: 9,787
Spam Patrol



I hate steortypes, but I was having a 'blonde' moment there.
Thanks, Spectre.
*kicks self*
Go to the top of the page
 
+Quote Post
vujsa
post Oct 15 2006, 10:56 PM
Post #4


Member [Level 2]
Group Icon

Group: [MODERATOR]
Posts: 80
Joined: 25-March 05
Member No.: 4,879



If that was the answer, I so totally didn't understand the question. The special characters are used for formating text only. They are generally used in PHP to format the outputed HTML like so:

This PHP:
CODE
echo "<body>\n\t<table>\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\tContent Here!<br />\n\t\t\t\tMore content here!\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n</body>";


Would output this HTML:
CODE
<body>
    <table>
        <tr>
            <td>
                Content Here!<br />
                More content here!
            </td>
        </tr>
    </table>
</body>


Which after the browser displays it would look like this:
QUOTE
Content Here!
More content here!


I use this to format my HTML in a way that makes it more organized and easier to read later. Makes debugging much easier.

This is also used for line breaks and tabs in the HTML textarea object.

Hope this helps. cool.gif
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Installing Apache + Php5 + Mysql(0)
  2. Is Php Working Fine For You These Days?(5)
  3. Create A Windows User Account(1)
  4. Counting Characters Of Textarea...(3)
  5. Max Characters Is X?(3)
  6. Unexpected $ Where There Aren't Any(7)
  7. Converting Characters In A Variable To Individual Values In An Array(2)
  8. Email Server Help Please(0)
  9. Parsing Html As Php(7)
  10. Script Not Working :s(5)
  11. Validation Script - Detecting Illegal Characters(0)
  12. Windows Login Credentials(0)
  13. Converting Textarea Return Characters To <br />(9)
  14. Script Not Working(6)
  15. Php Code Needed(5)
  1. Windows Can Be Hacked Via Firewire(11)
  2. Compiling Php On Windows(5)


 



- Lo-Fi Version Time is now: 13th October 2008 - 12:10 PM