is there a php script which validates form entry?
You can validate yourself using regular expressions.
After you make a few filters for certain things like username, you can reuse them.
If you really want a premade one you can use this, which I found at the top of my google search for “free php filtering class”.