Let's say you wanted to limit a user to the following characters for entry into a form field - the order must be flexible.
space $ , - : ' . & 0-9 a-z A-Z
If the user types or pastes any other characters, we want an error message to send him back and redo it.
This is what I have so far -- and its not working:
if (!eregi("[ \$\,-:a-zA-Z0-9]+$", $fnote))
{
... send user back to again...
}
Anyone have any suggestions?