Backend Validate Function In lib.php