On Sun, 7 Jul 2002, andy wrote:
> Alberto Serra <[EMAIL PROTECTED]> schrieb:
>> andy wrote:
>>> One Form has a textfield, I submit it to another html site where there
>>> is another form with a textfield. Inside this textfield I place a
>>> hidden field with the value of the field from page 1 then I submit to
>>> the actual php site inserting the values into a db.
>> So, let's see if I got you right:
>> Form 1: a textfield, you submit it to another page (no matter whether it
>> is on the same host or not, this should not make any difference)
>> Form 2 contains:
>>    1) a hidden field with the value from form 1
>>    2) another text field for new user input
>> You submit form 2 and nl2br does not work on the values of the hidden
>> field. Right?
>> If that is so it's simply because once the value gets put in
>> form2/field1 it has already lost the new lines.
>> So you should run nl2br on it *before* it gets submitted the second
>> time. Do it when you send the value to form2.
> I did try this out, but somehow this happens:
> text br / br / text in new line
> br/ is exacly where the linebrakes should be, but instead it is typed on
> screen.
> Is there a solution for this?

That looks like the result of htmlentities(nl2br($string)).

Do it the other way around.

Better yet, don't call nl2br or htmlentities or anything else on data that
you are inserting into your database. Madness that way lies.
Instead, use those functions only when outputting data to the browser.


P.S. Please stop spamming the rec.travel.* newsgroups.

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to