'' ,'email' =>'' ,'pswd' =>'' ,'re_pswd' =>'' ); $error = array( 'name' =>'' ,'email' =>'' ,'pswd' =>'' ); if(!empty($_POST)) { $values = $_POST; $values = strip_magic_quotes($values); if( !preg_match('|^[0-9a-z-\'`\s]{1,64}$|i',$values['name']) ){ $error['name'] = '*'; $is_error = true; } if( !preg_match( '^[a-zA-Z0-9._%-]+@[a-zA-Z0-9._%-]+\.[a-zA-Z]{2,6}$^',$values['email']) ){ $error['email'] = '*'; $is_error = true; } if( !preg_match('|.{4,}|i',$values['pswd']) ){ $error['pswd'] = 'Password must be longer then 4 simbols.'; $is_error = true; } elseif($values['pswd'] != $values['re_pswd']) { $error['pswd'] = 'Passwords does not coincide.'; $is_error = true; } if(!$is_error) { if( !getByUserEmail($values['email']) ) { $sql = "INSERT INTO `User` ( `User_id`, `User_name`, `User_email`, `User_pswd`, `User_add`, `User_status`, `User_isadmin`, `User_active`) VALUES "; $sql .= "('' , '". mysql_real_escape_string($values['name']) ."' , '". mysql_real_escape_string($values['email']) ."' , '". mysql_real_escape_string(md5($values['pswd'])) ."' , '". date('Y-m-d H:i:s') ."' , 'new' , '0' , '1' )"; if($query = mysql_query($sql)) { // Send notification $to = _TO_EMAIL_; $subject = "New User Sign Up on toddkerns.com site"; $text = "User Name: ". $values['name'] ."\n\r"; $text .= "User Email: ". $values['email'] ."\n\r"; $text .= "User Added: ". date('F j, Y H:s') ."\n\r"; $headers = 'From: '. _FROM_EMAIL_ . "\r\n" . 'Reply-To: '. _FROM_EMAIL_ . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $text, $headers); // End send of notification setcookie("notes",'

Your account successfull create. Please login.

', 0); header('Location: login.html'); } else { die(mysql_errno() . ": " . mysql_error()); } } else { $is_error = true; $_error_msg = "This email already exists."; } } else { $_error_msg = "Please correct errors and re-submit form."; } } ?> TK Army

TK ARMY

Want to receive the latest updates on Todd Kerns?  Sign up below to become a member of the TK Army!

Name:
E-Mail:
Password:
Confirm:

Already user? Please login.


Welcome

You registred:

Your email:

AdminPanel | Logout