Jump to content


This topic is now archived and is closed to further replies.


ereg() issues with <textarea>

Recommended Posts

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?

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.