本文整理匯總了PHP中validation::codePostal方法的典型用法代碼示例。如果您正苦於以下問題:PHP validation::codePostal方法的具體用法?PHP validation::codePostal怎麽用?PHP validation::codePostal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類validation
的用法示例。
在下文中一共展示了validation::codePostal方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: VALUES
if (empty($phone) || !validation::telephone($phone)) {
$errMessagesArray["phone"] = "Vous devez fournir un numéro de téléphone valide";
$isSubmissionValid = false;
}
// Address check
if (empty($address)) {
$errMessagesArray["address"] = "Vous devez fournir une adresse valide";
$isSubmissionValid = false;
}
// City check
if (empty($city)) {
$errMessagesArray["city"] = "Vous devez fournir un nom de ville";
$isSubmissionValid = false;
}
// Postal check
if (empty($postalCode) || !validation::codePostal($postalCode)) {
$errMessagesArray["postalCode"] = "Vous devez fournir un code postal valide";
$isSubmissionValid = false;
}
if ($isSubmissionValid) {
// Put user in database
try {
$database->beginTransaction();
if ($postType == 'register') {
$database->requete("INSERT INTO st_authentication \n\t (matricule, password) \n\t VALUES ('" . $matricule . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . md5($password) . "')");
$database->requete("INSERT INTO st_user_metadata \n\t\t\t\t\t\t\t\t\t(matricule,lastname,firstname,address,city,zipcode,tel_1,email)\n\t\t\t\t\t\t\t\t\tVALUES \n\t\t\t\t\t\t\t\t\t('" . $matricule . "',\n\t\t\t\t\t\t\t\t\t'" . $lastName . "',\n\t\t\t\t\t\t\t\t\t'" . $firstName . "',\n\t\t\t\t\t\t\t\t\t'" . $address . "',\n\t\t\t\t\t\t\t\t\t'" . $city . "',\n\t\t\t\t\t\t\t\t\t'" . $postalCode . "',\n\t\t\t\t\t\t\t\t\t'" . $phone . "',\n\t\t\t\t\t\t\t\t\t'" . $email . "')");
$database->commitTransaction();
if (config::SendEmail) {
$pregArray = array(array('key' => "/@@LASTNAME@@/", 'value' => $lastName), array('key' => "/@@FIRSTNAME@@/", 'value' => $firstName));
util::sendEmail($email, 'email.txt', $pregArray, "Stationnement AEP - Creation de compte");
}