$proctorpost = $_POST['ProctorPost'];
 $proctormail = $_POST['ProctorMainEmail'];
 $proctormail2 = $_POST['AdditionalEmails'];
 $phoneno = $_POST['PrimaryPhone'];
 $phone2 = $_POST['AdditionalPhones'];
 $centerid = $_POST['centerid'];
 //Sanitize the POST values
 $proctorname = clean($_POST['ProctorName']);
 $proctorpost = clean($_POST['ProctorPost']);
 $proctormail = clean($_POST['ProctorMainEmail']);
 $proctormail2 = clean($_POST['AdditionalEmails']);
 $phoneno = clean($_POST['PrimaryPhone']);
 $phone2 = clean($_POST['AdditionalPhones']);
 $centerid = clean($_POST['centerid']);
 $errors = array();
 if (!EmailValidation($proctormail)) {
     $errors[] = "The email appears to be in valid";
 }
 if (strlen($proctorname) == 0) {
     $errors[] = "Please specify the Proctor's Name";
 }
 if (strlen($centerid) == 0) {
     $errors[] = "Ensure you add a valid Center Id";
 }
 if (!fnValidateNumber($phoneno)) {
     $errors[] = "Number is not valid, please try removing spaces and enter with the ISD code";
 }
 // were there any errors?
 if (count($errors) > 0) {
     $errorString = '<p>There was an error processing the form.</p>';
     $errorString .= '<ul>';
Exemple #2
0
/**
* User submitted the form. Validate the request and email a validation link.
* 
*/
function SumbitRequest()
{
    $error = null;
    $recaptcha_key = GetSetting('recaptcha_key');
    $recaptcha_secret = GetSetting('recaptcha_secret');
    if ($recaptcha_key && $recaptcha_secret) {
        if (isset($_REQUEST['g-recaptcha-response'])) {
            $response = urlencode($_REQUEST['g-recaptcha-response']);
            $url = "https://www.google.com/recaptcha/api/siteverify?secret={$recaptcha_secret}&response={$response}";
            $data = http_fetch($url);
            $check = json_decode($data, true);
            if (isset($check) && $check !== false && is_array($check) && isset($check['success'])) {
                if (!$check['success']) {
                    $error = "Captcha challenge failed";
                }
            } else {
                $error = "Error validating the captcha (could not communicate with server)";
            }
        } else {
            $error = "Please answer the captcha challenge";
        }
    }
    if (isset($error)) {
        echo $error;
    } else {
        if (isset($_REQUEST['agree']) && $_REQUEST['agree']) {
            $email = trim($_REQUEST['email']);
            if (!preg_match('/[^@]+@[^\\.]+\\..+/', $email)) {
                echo 'Please provide a valid email address';
            } elseif (BlockEmail($email)) {
                echo 'Sorry, registration is not permitted.  Please contact us for more information.';
            } elseif ($keyinfo = GetKeyInfo($email)) {
                EmailKeyInfo($keyinfo);
            } elseif ($requestinfo = CreateRequest($email)) {
                EmailValidation($requestinfo);
            } else {
                echo 'Internal generating the API key request';
            }
        } else {
            echo 'Please agree to the terms and conditions';
        }
    }
}
Exemple #3
0
$address = $_POST['Address1'];
$phoneno = $_POST['PrimaryPhone'];
$country = $_POST['Country'];
$city = $_POST['CityName'];
$state = $_POST['state'];
//Sanitize the POST values
$centername = clean($_POST['CenterName']);
$email = clean($_POST['Email']);
$website = clean($_POST['Website']);
$address = clean($_POST['Address1']);
$phoneno = clean($_POST['PrimaryPhone']);
$country = clean($_POST['Country']);
$city = clean($_POST['CityName']);
$state = clean($_POST['state']);
$errors = array();
if (!EmailValidation($email)) {
    $errors[] = "The email appears to be in valid";
}
if (strlen($centername) == 0) {
    $errors[] = "Please specify a Center Name";
}
if (strlen($country) == 0) {
    $errors[] = "Ensure you choose a country please";
}
if (strlen($address) == 0) {
    $errors[] = "Please provide the Center's Address";
}
if (strlen($city) == 0) {
    $errors[] = "The Center's City was not specified.";
}
if (strlen($state) == 0) {
</form>
                    <?php 
        if (isset($_POST['Submit'])) {
            $tamail = $_POST['tamail'];
            $cid = $_POST['courseid'];
            $studentid = $USER->id;
            $firstname = $USER->firstname;
            $lastname = $USER->lastname;
            $email = $USER->email;
            $firstname = mysql_real_escape_string($USER->firstname);
            $lastname = mysql_real_escape_string($USER->lastname);
            $email = mysql_real_escape_string($USER->email);
            $tamail = mysql_real_escape_string($tamail);
            $errors = array();
            if (!EmailValidation($tamail)) {
                $errors[] = "The email appears to be in valid";
            }
            if (strlen($cid) == 0) {
                $errors[] = "Please choose the course you wish to drop";
            }
            // were there any errors?
            if (count($errors) > 0) {
                $errorString = '<p>There was an error processing the form.</p>';
                $errorString .= '<ul>';
                foreach ($errors as $error) {
                    $errorString .= "<li>{$error}</li>";
                }
                $errorString .= '</ul>';
                echo $errorString;
                // display the previous form