input validation at the client yes, input validation at the server definately
make use of the inbuilt PHP functions such as
mysql_real_escape_string
don't trust anything from outside the system (any user input)
don't trust anything that may be stored on or modified on the remote system (eg cookies, POST,GET or other variables)
in essence this is to big a topic for a site such as this, in part because we don't seem to get much activity on the PHP forums these days. so I'd suggest you find a site which specialises in PHP
you may also want to look at
mysql_client_encoding() - Returns the name of the character set
addslashes() - Quote string with slashes
stripslashes() - Un-quotes a quoted string
The magic_quotes_gpc directive
The magic_quotes_runtime directive