Hello all ,
i wondering about making WYSIWYG reply box
is it possible to make reply box by using php ?
and what is the basics ?
if it's not possible .. how can i make new line useing text area when i insert it into table
i need to insert <br> when the member press enter key without see it ..
Question about WYSIWYG
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Question about WYSIWYG
There are a number of rich text editors. CKEditor and TinyMCE are two good and popular ones. Take a look at those.
If you want to use PHP then you need to convert "<br/>" to "\n" after you read the data, display the data in a textarea, and then convert "\n" back to "<br/>" before you save the data.
If you want to use PHP then you need to convert "<br/>" to "\n" after you read the data, display the data in a textarea, and then convert "\n" back to "<br/>" before you save the data.
(#10850)
Re: Question about WYSIWYG
thanks for reply ..
the question is .. how can i tell php that this is a new line if the member using textarea and he had type something like this
if i called textarea topic then
so how could i know that it's a new line .. and insert <br>

the question is .. how can i tell php that this is a new line if the member using textarea and he had type something like this
between every line there is an empty line" Hi all
How are u
i hope u r fine "
if i called textarea topic then
Code: Select all
$topic = $_POST['topic']; /// that would make the topic in on line .. not in differ lines Re: Question about WYSIWYG
\n is a special character for line breaks.If you want to use PHP then you need to convert "<br/>" to "\n" after you read the data, display the data in a textarea, and then convert "\n" back to "<br/>" before you save the data.
- PHPHorizons
- Forum Contributor
- Posts: 175
- Joined: Mon Sep 14, 2009 11:38 pm
Re: Question about WYSIWYG
To be a bit more specific, what the user sees when they type into a textbox is different from the characters that are actually there. Pressing the enter key actually causes a NEW LINE character to be placed into the string: \n
But, the user only sees a new line. Therefore, you can search for \n and replace with <br>
In other words, here is what that string looks like to the computer:
But, the user only sees a new line. Therefore, you can search for \n and replace with <br>
In other words, here is what that string looks like to the computer:
Make sense?" Hi all\n\nHow are u\n\ni hope u r fine "
Re: Question about WYSIWYG
ahaa ... i got it ..PHPHorizons wrote:To be a bit more specific, what the user sees when they type into a textbox is different from the characters that are actually there. Pressing the enter key actually causes a NEW LINE character to be placed into the string: \n
But, the user only sees a new line. Therefore, you can search for \n and replace with <br>
In other words, here is what that string looks like to the computer:Make sense?" Hi all\n\nHow are u\n\ni hope u r fine "
u r genius thank you so much .
- PHPHorizons
- Forum Contributor
- Posts: 175
- Joined: Mon Sep 14, 2009 11:38 pm
Re: Question about WYSIWYG
You're welcome 