Jump to content


ereg() issues with <textarea>

  • Please log in to reply
No replies to this topic

#1 lead2gold

  • Members
  • PipPipPip
  • Advanced Member
  • 164 posts
  • LocationOttawa, On

Posted 10 April 2006 - 01:11 AM

I'm trying to parse a <textarea name='textarea'></textarea> after a submit. Everything parses fine until someone creates a new line (presses enter)

 if (!ereg('^[0-9A-Za-z\r\n\t<>&()\/\'\" ]+$', $POST['textarea'])){
  echo "error";

I thought \r and(/or) \n are the commands that are created a new line, but it appears it is something else. The regular expression defined above won't pick it up.
What am i overlooking/doing wrong?

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users