Too much time elapsed. Please try again.","REASON":"token_error"}'; } } if ((empty($_POST['form-password']))) {} else{$errors['form-password'] = 'spam check';} // Check for Errors if ((empty($_POST['email'])) or ($_POST['email'] == "Enter your e-mail*")) { echo '{"SUCCESS":"false","CONFIRMATION":"Please enter an email address","REASON":"email_not_provided"}'; $errors['email'] = '
*Valid Email Required
'; } else { if (check_email_address($_POST['email'])) { $validEmail = "true"; if(empty($_POST['form-contact-page-hidden'])){ if ((empty($_POST['name'])) or ($_POST['name'] == "Enter your name*")) { echo '{"SUCCESS":"false","CONFIRMATION":"Please enter a name","REASON":"name_not_provided"}'; $errors['name'] = '
*Valid Name Required
'; } } } else { $errors['email'] = '
*Valid Email Required
'; echo '{"SUCCESS":"false","CONFIRMATION":"Please enter a valid email address","REASON":"email_invalid"}'; } } // if no errors if ( empty($errors) && empty($_POST['form-contact-page-hidden']) ) { // Success from all signups echo '{"SUCCESS":"true","CONFIRMATION":"FURTHER ACTION REQUIRED
Please check your email and click on the link to confirm your subscription"}'; // Interface with Lyris $fields['name'] = $_POST['name']; $fields['email'] = $_POST['email']; $fields['list'] = 'uraniumenergy_com'; //$fields['confirm'] = 'none'; //$fields['showconfirm'] = 'F'; //print_r($fields); foreach($fields as $key => $val) { $post_variables .= $key.'='.$val.'&'; } $post_variables = substr($post_variables,0,-1); $ch = curl_init('http://dissemination.blendermedia.com:81/subscribe/subscribe.tml'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_variables); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); curl_close($ch); /* POST TO WORDPRESS */ $post_variables .= 'form_to_mailpoet=true&list_id=3&admin_email=ehren@blendermedia.com'; $autonews_post_variables = 'form_to_mailpoet=true&email='.$fields['email'].'&list_id=3&admin_email=ehren@blendermedia.com'; $post_variables = substr($autonews_post_variables,0,-1); $ch = curl_init('http://em.blendermedia.com/uec/'); if (!$ch) { echo 'Error ['.curl_errorno($ch).']: '.curl_error($ch); } curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_POSTFIELDS, $autonews_post_variables); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); curl_close($ch); // Email Confirmation $name= 'Uranium Energy'; $from= $_POST['email']; $fromname= $_POST['name']; $subject= $_POST['adsource'] . 'Addition to Uranium Energy Email List'; $message= "The following person has joined your email list: \n\rName: " . trim($_POST['name']) . "\nEmail: " . trim($_POST['email']) . "\nPhone: " . trim($_POST['phone']) . "\n\n". "IP:" . $_SERVER['REMOTE_ADDR']; $mail = new PHPMailer(); $mail->isHTML(false); $mail->IsSMTP(); // set mailer to use SMTP $mail->From = 'info@uraniumenergy.net'; $mail->FromName = 'UEC Website Signups'; $mail->Host = "smtp.sendgrid.net"; // specify main and backup server $mail->AddAddress('mehranb@uraniumenergy.com', 'Uranium Energy'); $mail->AddBCC('signups@blendermedia.com', 'Blender Media Signups'); $mail->SMTPAuth = true; // These three lines are necessary $mail->Username = 'blendermedia2'; // only if your SMTP server $mail->Password = 'telus351'; // requires authentication $mail->Subject = $subject; $mail->Body = $message; if(!$mail->Send()) { } else { } } elseif ( empty($errors) && $_POST['form-contact-page-hidden'] == 'true' ) { echo '{"SUCCESS":"true","CONFIRMATION":"Thanks for getting in contact with us
Someone will be in touch with you shortly."}'; $name= 'Uranium Energy'; $from= $_POST['email']; $fromname= $_POST['name']; $subject= 'Contact from uraniumenergy.com website contact form'; $message= "Someone has attempted to get in touch with the following details: \n\r " . "\nEmail: " . trim($_POST['email']) . "\nIP:" . $_SERVER['REMOTE_ADDR'] . "\n\r================================================"; foreach($_POST as $key => $value) { if (strstr($key, 'contact_form_value_')) { $x = str_replace('contact_form_value_','',$key); $message .= "\n\rKey: " . $x . ' Value: ' . $value; } } $message .= "\n\r================================================"; $mail = new PHPMailer(); $mail->isHTML(false); $mail->IsSMTP(); // set mailer to use SMTP $mail->From = 'info@uraniumenergy.net'; $mail->FromName = 'UEC Website Signups'; $mail->Host = "smtp.sendgrid.net"; // specify main and backup server // $mail->AddAddress('chris@blendermedia.com', 'Uranium Energy'); $mail->AddAddress('mehranb@uraniumenergy.com', 'Uranium Energy'); $mail->AddBCC('signups@blendermedia.com', 'Blender Media Signups'); $mail->SMTPAuth = true; // These three lines are necessary $mail->Username = 'blendermedia2'; // only if your SMTP server $mail->Password = 'telus351'; // requires authentication $mail->Subject = $subject; $mail->Body = $message; if(!$mail->Send()) { } else { } } else { } } else { } ?>