Variations on my problem have been discussed elsewhere, so I hope I'm not duplicating! I'm implementing a simple Private Messaging System as part of a web app. I've got an annoying problem though when dynamically inserting text into a textarea box in order to make a reply. Getting the content and displaying it is fine, but I can't work out how to format it correctly. Obviously, I can't use html tags, but plain text formatting like line breaks and carriage returns seem to be ignored too. This happens when an existing message is being displayed either as part of a reply or as a thread in a new message. How do I check what formatting is being saved in my db? Or indeed what formatting is being sent back from my db?!
A:
A couple of questions to know better your problem
- how do you store values inside the database?
- which code transfers textarea value to database?
would be great to know these points to spot the problem
markcial
2010-03-18 12:16:54
A:
UPDATE:
Thanks for your replies, but I've worked it out. I was playing around and realised the problem was at the stage of sending the data to the db. I passed the text through the nl2br() function before sending it to the db and this seems(!) to have done the trick!
musoNic80
2010-03-18 14:26:25