Advertisement
cyberairman2013

Email Activation

May 8th, 2013
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. function register_user($register_data) {
  2.     $actual_link = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
  3.     $path_parts = pathinfo($actual_link);
  4.     array_walk($register_data, 'array_sanitize');
  5.     $register_data['password'] = md5($register_data['data']);
  6.    
  7.     $fields = '`' . implode('`, `', array_keys($register_data)) . '`';
  8.     $data = '\'' . implode('\', \'', $register_data) . '\'';
  9.    
  10.     mysql_query("INSERT INTO users ($fields) VALUES ($data)");
  11.     $activation_link = '$path_parts[\'dirname\']/activate.php?email=" . $register_data[\'email\'] . "&email_code=" . $register_data[\'email_code\'] . "';
  12.     email($register_data['email'], 'Activate Your Account', "Hello " . $register_data['first_name'] . ",\n\nYou need to activate your account so please use the link below:\n\n $activation_link\n\n- International World Alliance Human Resource Department
  13.     ");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement