Website Text Editor...

Status
Not open for further replies.
Hello,

I'm running a website where I'm offering members to create blogs within my site but for their own use and for some reason the default text editor is complete garbage and half the time when I post if there is any weird character or something it posts a blank page and it's just getting annoying to deal with. I want to just have a simple text editor, kind of like the one here at ars that I'm typing into, nothing super fancy it just has to be able to register a return as a return and possibly allow emoticons, but NOT necessary. For now I just need something that posts but also registers a return.

I also think it should be able to handle copying and pasting anything from word or any text editor into it. I know a few people who write some blogs in word and have posted it into our current one and it just errors out and doesn't work right. I think it's time for an upgrade to something else, preferably free. My site runs PHP. I'm currently using a regular textarea field but that's parsing it all together and not registering any returns.

Thanks in advance for the help or direction.

Mike
 

Xavin

Ars Legatus Legionis
30,828
Subscriptor++
What blog software are you using? It's a pretty bad idea to write your own with so many options out there, there's a lot of opportunities for security holes.

That said, there are a few issues if you are trying to roll your own. A normal textarea registers new lines just fine, but if you just dump that text into an html page they won't show up, because HTML ignores whitespace. You will need to go through before displaying and replace newlines with
Code:
<br />
Being able to paste text from Word and expecting it to retain styling is an entirely different story, and I have never found a solution that worked well.

You also need to sanitize the raw input, getting rid of malicious javascript and html and SQL. Honestly you sound like you are out of your depth, and taking raw input from the internet is tricky at the best of times.
 
Status
Not open for further replies.