Im trying to get a function to work to validate/sanitize $_GET vars on one of my sites but im having problems...
So, for instance a URL could look like - http://mysite.com/state.php?State=New+Hampshire.html or
http://mysite.com/state.php?State=California.html
The New+Hampshire or California is then put into a variable from $_GET
California works fine, im having no problems with that...
I want to use regex through eregi or even preg_match to check New+Hampshire for invalid characters, I only want a-zA-Z and + to be valid, anything else I want to fail validation, the problem is no matter how I try I can never get the + to validate...
So, for instance a URL could look like - http://mysite.com/state.php?State=New+Hampshire.html or
http://mysite.com/state.php?State=California.html
The New+Hampshire or California is then put into a variable from $_GET
California works fine, im having no problems with that...
I want to use regex through eregi or even preg_match to check New+Hampshire for invalid characters, I only want a-zA-Z and + to be valid, anything else I want to fail validation, the problem is no matter how I try I can never get the + to validate...






