Join us

RSAI member registration send

{source}

<?php
if(isset($_POST['email'])) {

// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "This email address is being protected from spambots. You need JavaScript enabled to view it.";
$email_subject = "RSAI Member registration appliance.";


function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}

// validation expected data exists
if(!isset($_POST['first_name']) ||
!isset($_POST['surname']) ||
!isset($_POST['email']) ||
!isset($_POST['establishment']) ||
!isset($_POST['department']) ||
!isset($_POST['address']) ||
!isset($_POST['city']) ||
!isset($_POST['country']) ||
!isset($_POST['statecode']) ||
!isset($_POST['zip']) ||
!isset($_POST['vat'])) {
died('We are sorry, but there appears to be a problem with the form you submitted.');
}

$first_name = $_POST['first_name']; // required
$surname = $_POST['surname']; // required
$email_from = $_POST['email']; // required
$establishment = $_POST['establishment']; // required
$department = $_POST['department']; // required
$address = $_POST['address']; // required
$city = $_POST['city']; // required
$country = $_POST['country']; // required
$statecode = $_POST['statecode']; // not required
$zip = $_POST['zip']; // required
$vat = $_POST['vat']; // not required

$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
$string_exp = "/^[A-Za-z .'-]+$/";
$string_num = "/^[A-Za-z0-9 .'-]+$/";
if(strlen($first_name) < 2) {
$error_message .= 'The First Name you entered does not appear to be valid.<br />';
}
if(strlen($surname) < 2) {
$error_message .= 'The Surname you entered does not appear to be valid.<br />';
}
if(strlen($establishment) < 1) {
$error_message .= 'The Establishment you entered does not appear to be valid.<br />';
}
if(strlen($department) < 1) {
$error_message .= 'The Department you entered does not appear to be valid.<br />';
}
if(strlen($address) < 2) {
$error_message .= 'The Address you entered does not appear to be valid.<br />';
}
if(strlen($city) < 2) {
$error_message .= 'The City you entered does not appear to be valid.<br />';
}
if(!preg_match($string_exp,$country)) {
$error_message .= 'The Country you entered does not appear to be valid.<br />';
}
if(!preg_match($string_num,$zip)) {
$error_message .= 'The Zip/Postal Code you entered does not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}

$email_message = "New RSAI member registration appliance information below.\n\n";

function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}

$email_message .= "First Name: ".clean_string($first_name)."\n";
$email_message .= "Surname: ".clean_string($surname)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Establishment: ".clean_string($establishment)."\n";
$email_message .= "Department: ".clean_string($department)."\n";
$email_message .= "Address: ".clean_string($address)."\n";
$email_message .= "City: ".clean_string($city)."\n";
$email_message .= "Country: ".clean_string($country)."\n";
$email_message .= "State Code: ".clean_string($statecode)."\n";
$email_message .= "Zip/Postal Code: ".clean_string($zip)."\n";
$email_message .= "VAT: ".clean_string($vat)."\n";


// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>

<!-- include your own success html here -->

Thank you for contacting us. We will be in touch with you very soon.

<?php
}
?>

{/source}

Read 17547 times
More in this category: « How to Join

About Us

The Regional Science Association International (RSAI), founded in 1954, is an international community of scholars interested in the regional impacts of national or global processes of economic and social change.

Get In Touch

Regional Science Association International
University of Azores, Oficce 155-156, Rua Capitão João D'Ávila, 9700-042 Angra do Heroísmo, Azores, Portugal

Hit Counter

Today249
Yesterday1349
This week2718
This month21403
Total1721282

Tuesday, 18 June 2019

Search