Form submission handler for ban_ip_form().
function ban_ip_form_submit($form, &$form_state) {
$ip = trim($form_state['values']['ip']);
db_insert('ban_ip')
->fields(array(
'ip' => $ip,
))
->execute();
drupal_set_message(t('The IP address %ip has been banned.', array(
'%ip' => $ip,
)));
$form_state['redirect'] = 'admin/config/people/ban';
}