[ciapug] Formatting with line breaks...

Jerry Weida ciapug@cialug.org
Mon, 15 Dec 2003 09:32:14 -0600


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
My suggestion, don't try to store the text formatted.&nbsp; Have it format
the data on the fly based on where you need to send it.&nbsp; Emails will
require a "\r\n" wherever you want a line break.&nbsp; Be sure you use
double quotes for that as well otherwise PHP won't do the translation.<br>
<br>
Chris Hettinger wrote:<br>
<blockquote type="cite"
 cite="midF1E03A25DAB40840B4AE300849242D0501E0222E@encmail.encompass.enc">
  <meta content="text/html; " http-equiv="Content-Type">
  <title></title>
  <meta name="GENERATOR" content="MSHTML 6.00.2800.1226">
  <div><span class="667271015-15122003"><font size="2" color="#0000ff"
 face="Arial"><span class="667271015-15122003"><font size="2"
 color="#0000ff" face="Arial">Background, I have a application that
collect information in a mysql db, does some processing, and based on
the outcome I either build a formatted email and send it, or do a
series of inserts into our mssql server and in this case I have to
insert a formatted notes entry.</font></span></font></span></div>
  <div><span class="667271015-15122003"></span>&nbsp;</div>
  <div><span class="667271015-15122003"><font size="2" color="#0000ff"
 face="Arial">I have to write this information two different&nbsp;ways, <span
 class="667271015-15122003"><font size="2" color="#0000ff" face="Arial">I
will do one or the other</font></span>:</font></span></div>
  <div><span class="667271015-15122003"></span>&nbsp;</div>
  <div><span class="667271015-15122003"><font size="2" color="#0000ff"
 face="Arial">1. Formatted Email Message</font></span></div>
  <div><span class="667271015-15122003"><font size="2" color="#0000ff"
 face="Arial">2. Into a long text DB field, that will then be displayed
in a internal application</font></span></div>
  <div><span class="667271015-15122003"></span>&nbsp;</div>
  <div><span class="667271015-15122003"></span>&nbsp;</div>
  <div><span class="667271015-15122003"><font size="2" color="#0000ff"
 face="Arial">Tim: No I had not used the &lt;pre&gt;&lt;/pre&gt; tags</font></span></div>
  <div><span class="667271015-15122003"></span>&nbsp;</div>
  <div><span class="667271015-15122003"><font size="2" color="#0000ff"
 face="Arial">-ch</font></span></div>
  <blockquote>
    <div align="left" dir="ltr" class="OutlookMessageHeader"><font
 size="2" face="Tahoma">-----Original Message-----<br>
    <b>From:</b> <a class="moz-txt-link-abbreviated" href="mailto:ciapug-admin@cialug.org">ciapug-admin@cialug.org</a>
[<a class="moz-txt-link-freetext" href="mailto:ciapug-admin@cialug.org">mailto:ciapug-admin@cialug.org</a>]<b>On Behalf Of </b>Jerry Weida<br>
    <b>Sent:</b> Monday, December 15, 2003 8:38 AM<br>
    <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:ciapug@cialug.org">ciapug@cialug.org</a><br>
    <b>Subject:</b> Re: [ciapug] Formatting with line breaks...<br>
    <br>
    </font></div>
Where are you writing this output to?&nbsp; A file?&nbsp; A browser?<br>
    <br>
Chris Hettinger wrote:<br>
    <blockquote type="cite"
 cite="midF1E03A25DAB40840B4AE300849242D05017C0A36@encmail.encompass.enc">
      <pre wrap="">Hmm, this didn't seem to work either.

        $note = "*** Generate from Web Form Submission ***" . chr(13) . chr(10)
              . "testing note formatting.";

Still writes a single line.  hrmmm... 

*still trying*





-----Original Message-----
From: David Champion [<a href="mailto:dave@visionary.com"
 class="moz-txt-link-freetext">mailto:dave@visionary.com</a>]
Sent: Friday, December 12, 2003 4:56 PM
To: <a href="mailto:ciapug@cialug.org" class="moz-txt-link-abbreviated">ciapug@cialug.org</a>
Subject: Re: [ciapug] Formatting with line breaks...


You're thinking of a different issue, Jerry. That's addressed with the 
nl2br() function.

He needs to actually insert :
$x = "text " . chr(13) . chr(10);

I don't recall that there's a constant for CRLF, like VB's vbCRLF... but 
you could put on in your code, i.e.

$_CRLF = chr(13) . chr(10);

-dc

Jerry Weida wrote:

  </pre>
      <blockquote type="cite">
        <pre wrap="">Are you checking the source?  Text-style line breaks won't display in 
a browser, but they will show up in the source.

Chris Hettinger wrote:

    </pre>
        <blockquote type="cite">
          <pre wrap="">I am trying to insert into a db field a note entry which will contain 
the details of a web form, but I have to build that long note entry 
first, and do some light formatting like line breaks...

       $note = "Generate from Web Form Submission \r\n"
             . "testing note formatting. \r\n";

How ever this isn't working as I would have suspected. For testing it 
as I build it I am just echoing it out to the browser with &lt;?= $note; 
?&gt; ... It displays but is not including the line breaks.
      </pre>
        </blockquote>
      </blockquote>
      <pre wrap=""><!---->

_______________________________________________
ciapug mailing list
<a href="mailto:ciapug@cialug.org" class="moz-txt-link-abbreviated">ciapug@cialug.org</a>
<a href="http://cialug.org/mailman/listinfo/ciapug"
 class="moz-txt-link-freetext">http://cialug.org/mailman/listinfo/ciapug</a>


CONFIDENTIALITY NOTICE:  This communication, including any attachment, may contain confidential information and is intended only for the individual or entity to whom it is addressed.  Any review, dissemination, or copying of this communication by anyone other than the intended recipient is strictly prohibited.  If you are not the intended recipient, please contact the sender by reply email, delete and destroy all copies of the original message.'

_______________________________________________
ciapug mailing list
<a href="mailto:ciapug@cialug.org" class="moz-txt-link-abbreviated">ciapug@cialug.org</a>
<a href="http://cialug.org/mailman/listinfo/ciapug"
 class="moz-txt-link-freetext">http://cialug.org/mailman/listinfo/ciapug</a>
  </pre>
    </blockquote>
_______________________________________________ ciapug mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ciapug@cialug.org">ciapug@cialug.org</a> <a class="moz-txt-link-freetext" href="http://cialug.org/mailman/listinfo/ciapug">http://cialug.org/mailman/listinfo/ciapug</a></blockquote>
  <p><font size="2" face="Arial" color="#000000">CONFIDENTIALITY
NOTICE: This communication, including any attachment, may contain
confidential information and is intended only for the individual or
entity to whom it is addressed. Any review, dissemination, or copying
of this communication by anyone other than the intended recipient is
strictly prohibited. If you are not the intended recipient, please
contact the sender by reply email, delete and destroy all copies of the
original message.'<br>
  </font></p>
</blockquote>
</body>
</html>