A jQuery plugin and php function for client-side and server-side validation