enter in textarea problem
Moderator: General Moderators
- potato
- Forum Contributor
- Posts: 192
- Joined: Tue Mar 16, 2004 8:30 am
- Location: my lovely trailer, next to the big tree
enter in textarea problem
I have a textarea where i would enter a description.
But my problemisthat if i 'enter' in the textarea, i doesn't save the enter
in my mysql tabel.
How can i fix that?
But my problemisthat if i 'enter' in the textarea, i doesn't save the enter
in my mysql tabel.
How can i fix that?
Another way...
function convertReturns($input_text) {
$input_text = ereg_replace("\n","<BR>",$input_text);
return $input_text;
}
Then when you're displaying something from the mySQL database that needs to be returned and has those return line thinger majigs just do something like
convertReturns($row['news_article']);
function convertReturns($input_text) {
$input_text = ereg_replace("\n","<BR>",$input_text);
return $input_text;
}
Then when you're displaying something from the mySQL database that needs to be returned and has those return line thinger majigs just do something like
convertReturns($row['news_article']);
- andre_c
- Forum Contributor
- Posts: 412
- Joined: Sun Feb 29, 2004 6:49 pm
- Location: Salt Lake City, Utah
You can either use the function before you send to the database or after you retrieve it:
Code: Select all
$text = nl2br($text);