Hello I have multiple forms around my site and I have to check all to make sure there isnt numbers, spaces, special characters, ect. I know it has to deal with ereg and I have seen and tried to understand the information found on http://www.php.net/ereg but I still just cant seem to understand it well enough to make the function let alone make different versions of it. If anyone has maybe a link to a good tutorial on it or maybe...a short description how it should be set up and what I should replace would be great.
Thanks in advance
Howey
Checking if..
Moderator: General Moderators
hello,
being an regEx person, I would use:
being an regEx person, I would use:
Code: Select all
<?php
if (!ereg("^[_a-zA-Z0-9-]+$", $name)) {
die (ERROR);
}
?>