You are here

function shurly_create_form_submit in ShURLy 6

Same name and namespace in other branches
  1. 7 shurly.module \shurly_create_form_submit()

File

./shurly.module, line 298
description http://www.youtube.com/watch?v=Qo7qoonzTCE

Code

function shurly_create_form_submit($form, &$form_state) {
  global $base_url;

  // submit the short URL form
  $long_url = $form_state['storage']['shurly']['long_url'] = $form_state['values']['long_url'];
  $short_url = $form_state['storage']['shurly']['short_url'] = $form_state['values']['short_url'];
  $final_url = $form_state['storage']['shurly']['final_url'] = rawurldecode(_surl($short_url, array(
    'absolute' => TRUE,
    'base_url' => variable_get('shurly_base', $base_url),
  )));
  $custom = $form_state['custom'];
  if (empty($form_state['url_exists'])) {
    shurly_save_url($long_url, $short_url, NULL, $custom);
  }
}