eref, textarea, line breaks

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.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 20th, 2007, 05:56
Junior Member
Join Date: Mar 2006
Location: usa
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote

  #2 (permalink)  
Old Jan 20th, 2007, 08:37
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
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?
Reply With Quote
  #3 (permalink)  
Old Jan 20th, 2007, 18:13
Junior Member
Join Date: Mar 2006
Location: usa
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
Reply

Tags
ereg, line breaks, textarea

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 18:46.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43