"; ////include("../pages/color.php"); if(isset($errors)) { echo $errors; } include("../pages/header.php"); echo "




Resend Verification Email

"; $randtext = generateRandomString(500); $randtext = md5($randtext); $xtm = time()+60*60*24*1; $sql = "INSERT INTO `temp_token` (`easy_key`, `date_added`, `date_expired`, `ip_add`, `status`, `user_id`) VALUES ('$randtext', '$nowtime', '$xtm', '$ip_add', '1', '0')"; $res = mysqli_query($db, $sql); if(empty($_POST) == false) { $fields = array('email2', 'captcha'); foreach($_POST as $key=>$value) { if(empty($value) && in_array($key, $fields) == true){ $errors = 'All fields are required'; break 1; } } $captcha = $_POST['captcha']; $email = $_POST['email2']; $uddt = mysqli_fetch_array(mysqli_query($db, "SELECT COUNT(*), user_id, username, email, email_code, name, active FROM users WHERE email='$email'")); $tkn = mysqli_fetch_array(mysqli_query($db, "SELECT COUNT(*), easy_key, date_added, ip_add, status, user_id FROM temp_token WHERE easy_key='$captcha'")); if(empty($errors)) { if($tkn[0]=='0') { $errors = 'Security Key Not Found!'; $res = mysqli_query($db, "INSERT INTO error_log SET tried_username='$email', uid='$uddt[1]', username='$uddt[2]', email='$uddt[3]', action='Resend_Verification', error_msg='Security Key Not Found as $captcha $email', ip_add='$ip_add', time='$nowtime'"); } if($tkn[4]=='0') { $errors = 'Security key Already Used. Please Try Again!'; $res = mysqli_query($db, "INSERT INTO error_log SET tried_username='$email', uid='$uddt[1]', username='$uddt[2]', email='$uddt[3]', action='Resend_Verification', error_msg='security key $captcha already used by you or some one else $email', ip_add='$ip_add', time='$nowtime'"); } if($uddt[6]=='1') { $errors = "Your Account is already active! "; $res = mysqli_query($db, "INSERT INTO error_log SET tried_username='$email', uid='$uddt[1]', username='$uddt[2]', email='$uddt[3]', action='Resend_Verification', error_msg='Tried to Get Verification Email For previously Active Account', ip_add='$ip_add', time='$nowtime'"); } if($uddt[0] == '0') { $errors = 'Sorry, the username \'' . $_POST['email2'] . '\' is not exist.'; $res = mysqli_query($db, "INSERT INTO error_log SET tried_username='$email', uid='$uddt[1]', username='$uddt[2]', email='$uddt[3]', action='Resend_Verification', error_msg='$email does not exist, ip_add='$ip_add', time='$nowtime'"); } } } if(empty($_POST) == false && empty($errors) == true){ $knd = mysqli_fetch_array(mysqli_query($db, "SELECT user_id, username, email, email_code, name FROM users WHERE email='$email'")); $to = $knd[2]; $title = "$sitename : Verification Email On Request"; $message = "
EMAIL VERIFICATION
Verify Your Email Account
 
Hello $knd[4],
\n\n Your Login $email
\n\n We dont store your password in plane text format. its stored in encrypted format.\n\n To activate your account, access the link below:
\n\n $sitelink/activate/$email/$uddt[4]/ \n\n
 
VERIFY NOW
 
"; $headers = "From: $mydomain <$esender>\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; mail($to, $title, $message, $headers); echo "
We've Resent you Verification Email.
"; $res = mysqli_query($db, "INSERT INTO complete_log SET user_id='$knd[0]', user_name='$knd[1]', user_email='$knd[2]', action_type='Resend_Verification_Email', user_action='User Asked For Resend Verification Email.', secret_info='Email Code $knd[3]', ip_add='$ip_add', act_time='$nowtime', act_status='1'"); $sql = "UPDATE temp_token SET `use_for`='Resend_Verification_Email', `date_used`='$nowtime', `status`='0' WHERE easy_key='$captcha'"; mysqli_query($db, $sql); /////echo "
This Security Key is Disabled Now !
"; } else if(isset($errors)) { echo "
Error Occured $errors
"; } echo "

You Will get Verification Email Link Again in next Few minutes. Please Keep Safe Your Password !

"; include('sign-sidebar.php'); echo "
"; include("../pages/footer.php"); echo " "; ?>