At 2:10 PM -0400 5/15/09, Tom Worster wrote:
On 5/15/09 10:12 AM, "Stuart" wrote:
What's your problem with using nl2br?
it's not multibyte safe. if you're using mb strings, e.g. for utf8 pages and
forms, then use preg_replace (with the u modifier) instead of ml2br
Whoa -- and I thought yo
On 5/15/09 10:12 AM, "Stuart" wrote:
> What's your problem with using nl2br?
it's not multibyte safe. if you're using mb strings, e.g. for utf8 pages and
forms, then use preg_replace (with the u modifier) instead of ml2br
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visi
tedd wrote:
Also, one can generate validation errors using "" because there
are three different varieties of the tag, namely "", "", and
"" -- all of which can be used in different settings. I don't
remember which doctypes go with which version (xhtml requires />), but
I've run into that pr
At 11:19 AM -0400 5/15/09, Robert Cummings wrote:
On Fri, 2009-05-15 at 10:54 -0400, tedd wrote:
> 4. Or, listen to me (who is somewhere between Rob/Stuart and Sterex)
and use either the tag or the nlbr() function depending upon
what you want to do with the output. Both solutions [1 and 2] p
PHPScriptor wrote:
Hello,
How do you guys handle this "problem".
Just a form with a textarea. When I use enters in the textarea it's saved to
the db like this:
database:
"first line
second line"
when I edit the value in the form:
"first line
second line"
when I output the value to html:
"fir
At 11:29 AM -0400 5/15/09, Paul M Foster wrote:
On Fri, May 15, 2009 at 07:19:24AM -0700, PHPScriptor wrote:
Mja, that's not my intention, in that case I also could use nl2br...
Why does this problem exists? And why does it work with ? Is this a PHP
problem or more a HTML problem?
HTML d
At 8:38 PM +0530 5/15/09, Manoj Sterex wrote:
@tedd:
Its just another way of looking at the things. Putting HTML into the
DB is not really wrong (perhaps in this context it is). If you do
have HTML in the DB, you can directly echo it out and use CSS to
style it accordingly. Just my 2 cents. :)
On Fri, 2009-05-15 at 11:29 -0400, Paul M Foster wrote:
> On Fri, May 15, 2009 at 07:19:24AM -0700, PHPScriptor wrote:
>
> >
> > Mja, that's not my intention, in that case I also could use nl2br...
> >
> > Why does this problem exists? And why does it work with ? Is this a PHP
> > problem or mor
On Fri, May 15, 2009 at 07:19:24AM -0700, PHPScriptor wrote:
>
> Mja, that's not my intention, in that case I also could use nl2br...
>
> Why does this problem exists? And why does it work with ? Is this a PHP
> problem or more a HTML problem?
HTML doesn't recognize newlines when it displays te
On Fri, 2009-05-15 at 10:54 -0400, tedd wrote:
> At 7:22 AM -0700 5/15/09, PHPScriptor wrote:
> >Well, the problem is that I have a lot of forms, a lot of data to output, and
> >even then, I don't know always where I have a textarea or just a inputfield.
> >But true, I could even set the nl2br on a
@tedd:
Its just another way of looking at the things. Putting HTML into the DB is
not really wrong (perhaps in this context it is). If you do have HTML in the
DB, you can directly echo it out and use CSS to style it accordingly. Just
my 2 cents. :)
-Sterex
On Fri, May 15, 2009 at 8:24 PM, tedd
At 7:22 AM -0700 5/15/09, PHPScriptor wrote:
Well, the problem is that I have a lot of forms, a lot of data to output, and
even then, I don't know always where I have a textarea or just a inputfield.
But true, I could even set the nl2br on an input field, it wouldn't make a
difference.
But I just
2009/5/15 PHPScriptor :
>
> Well, the problem is that I have a lot of forms, a lot of data to output, and
> even then, I don't know always where I have a textarea or just a inputfield.
> But true, I could even set the nl2br on an input field, it wouldn't make a
> difference.
> But I just don't unde
TinyMCE: http://tinymce.moxiecode.com/
-Sterex
On Fri, May 15, 2009 at 7:56 PM, Paul M Foster wrote:
> On Fri, May 15, 2009 at 07:03:49AM -0700, PHPScriptor wrote:
>
> >
> > Hello,
> >
> > How do you guys handle this "problem".
> >
> > Just a form with a textarea. When I use enters in the textar
@Robert:
True. I was assuming that the text was going to be final and not being
edited again.
@PHPScriptor:
If you do have a lot of textareas to work around with, why don't you give
TinyMCE a try. Thats the best option you have got. It replaces the textarea
into more of a html compatible one and w
Well, its not exactly a 'problem' at all. The textarea just does what its
meant to do - accept raw text input and lets you process it via form action.
This is neither a PHP or a HTML 'problem'.
The reason you cannot see the line breaks when you echo the text on your
browser is the fact that the br
On Fri, May 15, 2009 at 07:03:49AM -0700, PHPScriptor wrote:
>
> Hello,
>
> How do you guys handle this "problem".
>
> Just a form with a textarea. When I use enters in the textarea it's saved to
> the db like this:
>
> database:
> "first line
> second line"
>
> when I edit the value in the f
On Fri, 2009-05-15 at 19:48 +0530, Manoj Sterex wrote:
> Well, instead of storing the text from the textarea directly into the db,
> validate it and wrap it with tags (replace \n) and then store it.
> This way you needn't use nl2br every time you retrieve the text from db.
Don't do that unless it
Yes, I thought about that. But then you have a problem when you're going to
'edit' that data back in a form. Then you get "first linesecond line"
in your textarea.
Manoj Sterex wrote:
>
> Well, instead of storing the text from the textarea directly into the db,
> validate it and wrap it with t
Well, the problem is that I have a lot of forms, a lot of data to output, and
even then, I don't know always where I have a textarea or just a inputfield.
But true, I could even set the nl2br on an input field, it wouldn't make a
difference.
But I just don't understand why this problem exists? Wha
Mja, that's not my intention, in that case I also could use nl2br...
Why does this problem exists? And why does it work with ? Is this a PHP
problem or more a HTML problem?
Robert Cummings wrote:
>
> On Fri, 2009-05-15 at 07:03 -0700, PHPScriptor wrote:
>> Hello,
>>
>> How do you guys handle
Well, instead of storing the text from the textarea directly into the db,
validate it and wrap it with tags (replace \n) and then store it.
This way you needn't use nl2br every time you retrieve the text from db.
-Sterex
On Fri, May 15, 2009 at 7:42 PM, Stuart wrote:
> 2009/5/15 PHPScriptor :
2009/5/15 PHPScriptor :
>
> Hello,
>
> How do you guys handle this "problem".
>
> Just a form with a textarea. When I use enters in the textarea it's saved to
> the db like this:
>
> database:
> "first line
> second line"
>
> when I edit the value in the form:
> "first line
> second line"
>
> when
On Fri, 2009-05-15 at 07:03 -0700, PHPScriptor wrote:
> Hello,
>
> How do you guys handle this "problem".
>
> Just a form with a textarea. When I use enters in the textarea it's saved to
> the db like this:
>
> database:
> "first line
> second line"
>
> when I edit the value in the form:
> "fir
m of type?
>
> tx again
> adi
>
>
> - Original Message -----
> From: "Henning Sittler" <[EMAIL PROTECTED]>
> To: "'adi'" <[EMAIL PROTECTED]>
> Sent: Friday, July 05, 2002 4:05 PM
> Subject: RE: [PHP] textarea new line
>
he newlines
disappear!
ps.column 1 have type "text" or "varchar(100)"
Is a problem of type?
tx again
adi
- Original Message -
From: "Henning Sittler" <[EMAIL PROTECTED]>
To: "'adi'" <[EMAIL PROTECTED]>
Sent: Friday, July 05,
When you echo, you are adding to HTML, so you need for new lines
not \n. There is a function called nl2br that converts the nl into br's
for you, so do this;
$string="-line1n\ -line2 n\-line3";
$string = nl2br($string);
echo "$string";
adi wrote:
>i want to add in textarea a string with
Sorry, you DO need nl's, but it's \n not n\
PHPCoder wrote:
> When you echo, you are adding to HTML, so you need for new lines
> not \n. There is a function called nl2br that converts the nl into
> br's for you, so do this;
>
> $string="-line1n\ -line2 n\-line3";
>
> $string = nl2br($string)
28 matches
Mail list logo