This is a discussion on "eref, textarea, line breaks" within the PHP Forum section. This forum, and the thread "eref, textarea, line breaks are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
eref, textarea, line breaks
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
eref, textarea, line breaks
my ereg code works well until it encounters a line break, then will not resolve the string. Take a look and see if you can find a solution... if(!ereg("^([a-zA-Z0-9_\.!#\$&\*\+\=\(\)-:\"\', /\\%])*$", $notes)) This is the "notes" text that goes into the textarea textarea text: This is the text that goes into the textarea to: 1) see if it works 2) see what it looks like 3) quit this part of the script so that is it for now you guy's! end Thanks for your help!! David |
|
|
|
|||
|
Re: eref, textarea, line breaks
The short answer is that you probably want to add \n if you're looking to eliminate "naughty" characters but accept new lines.
But you might do better to use strspn, or strcspn. And I'm not sure of your context - have you seen stripslashes and its friends? |
|
|||
|
Re: eref, textarea, line breaks
Thanks for your reply Grahame.
Adding \n\r\t took care of the problem and Thanks!! I am using stripslashes and mysql_escape_string as necessery. I don't know about strspn or strcspn, but will check them both now. Stripslashes is all I am familiar with... what else is in its family? Thanks for your help!! David |
![]() |
| Tags |
| ereg, line breaks, textarea |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Seeing Line Breaks? | Jack Franklin | PHP Forum | 2 | Feb 24th, 2008 20:55 |
| Line breaks | alexgeek | Other Programming Languages | 1 | Nov 1st, 2007 01:51 |
| retrieving and displaying line breaks | nate2099 | Databases | 1 | Jul 13th, 2007 08:56 |
| transorm xml in textarea | scribble | Other Programming Languages | 0 | Nov 29th, 2006 23:18 |
| Adding RETURN line breaks to a database | Lizard- | Classic ASP | 2 | Aug 19th, 2004 09:49 |