本文整理汇总了PHP中check::firstname方法的典型用法代码示例。如果您正苦于以下问题:PHP check::firstname方法的具体用法?PHP check::firstname怎么用?PHP check::firstname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类check
的用法示例。
在下文中一共展示了check::firstname方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if ($_POST['submitfinish']) {
check::empty_fields(array("coupon"));
if (main::errors()) {
$order_form_array['ERRORS'] = style::replaceVar("tpl/order/errors.tpl", array()) . "<br><br>";
} else {
//We don't check that the TOS is checked because it will be seen as an empty field and get caught by check:empty_fields.
if (!check::user($postvar['username'])) {
main::errors(nl2br("The username was either taken or was in an invalid format.\n\n Usernames:\n 1.) Must be between 4-8 characters long\n 2.) Must not start with a number\n 3.) Must be alphanumeric"));
}
if (!check::pass($postvar['password'], $postvar['confirmp'])) {
main::errors(nl2br("Your passwords either do not match or contain invalid characters. (< and > are not allowed. O>.<O Nor is #"));
}
if (!check::email($postvar['email'])) {
main::errors(nl2br("Your email address didn't match one or more of the following:\n\n Your email address:\n 1.) Must be in the correct format\n 2.) Must not be associated with another client\n 3.) If you're using an email address hosted with us, please make sure your email address has the proper \"MX\" or \"A\" DNS record."));
}
if (!check::firstname($postvar['firstname'])) {
main::errors(nl2br("In our system, your first and last name may only contain letters and the following characters:.' - and space."));
}
if (!check::lastname($postvar['lastname'])) {
main::errors(nl2br("In our system, your first and last name may only contain letters and the following characters:.' - and space."));
}
if (!check::address($postvar['address'])) {
main::errors(nl2br("Your address may only contain letters, numbers and the following characters:.- and space."));
}
if (!check::city($postvar['city'])) {
main::errors(nl2br("Your city may only contain letters and spaces."));
}
if (!check::state($postvar['state'])) {
main::errors(nl2br("Your state may only contain letters and the following characters:.- and space"));
}
if (!check::zip($postvar['zip'])) {
示例2: content
public function content()
{
global $dbh, $postvar, $getvar, $instance;
$client = $dbh->client($_SESSION['cuser']);
$edit_account_array['USER'] = $client['user'];
$edit_account_array['EMAIL'] = $client['email'];
$edit_account_array['DOMAIN'] = $client['domain'];
$edit_account_array['FIRSTNAME'] = $client['firstname'];
$edit_account_array['LASTNAME'] = $client['lastname'];
$edit_account_array['ADDRESS'] = $client['address'];
$edit_account_array['CITY'] = $client['city'];
$edit_account_array['STATE'] = $client['state'];
$edit_account_array['ZIP'] = $client['zip'];
$edit_account_array['PHONE'] = $client['phone'];
$edit_account_array['TZADJUST'] = main::tzlist($client['tzadjust']);
$edit_account_array['DISP'] = "<div>";
$edit_account_array['COUNTRY'] = main::countries(1, $client['country']) . '<a title="Your country." class="tooltip"><img src="<ICONDIR>information.png" /></a>';
if ($_POST) {
if (!check::email($postvar['email'], $_SESSION['cuser'])) {
main::errors("Your email is the wrong format!");
}
if (!check::state($postvar['state'])) {
main::errors("Please enter a valid state!");
}
if (!check::address($postvar['address'])) {
main::errors("Please enter a valid address!");
}
if (!check::phone($postvar['phone'])) {
main::errors("Please enter a valid phone number!");
}
if (!check::zip($postvar['zip'])) {
main::errors("Please enter a valid zip/postal code!");
}
if (!check::city($postvar['city'])) {
main::errors("Please enter a valid city!");
}
if (!check::firstname($postvar['firstname'])) {
main::errors("Please enter a valid first name!");
}
if (!check::lastname($postvar['lastname'])) {
main::errors("Please enter a valid time last name!");
}
if (!main::errors()) {
if ($postvar['country']) {
$country_q = "";
}
$users_update = array("email" => $postvar['email'], "state" => $postvar['state'], "address" => $postvar['address'], "phone" => $postvar['phone'], "zip" => $postvar['zip'], "city" => $postvar['city'], "tzadjust" => $postvar['tzones'], "firstname" => $postvar['firstname'], "lastname" => $postvar['lastname'], "country" => $postvar['country']);
$dbh->update("users", $users_update, array("id", "=", $_SESSION['cuser']));
if ($postvar['change']) {
$client = $dbh->client($_SESSION['cuser']);
if (crypto::passhash($postvar['currentpass'], $client['salt']) == $client['password']) {
if ($postvar['newpass'] === $postvar['cpass']) {
$cmd = main::changeClientPassword($_SESSION['cuser'], $postvar['newpass']);
if ($cmd === true) {
main::errors("Details updated!");
} else {
main::errors((string) $cmd);
}
} else {
main::errors("Your passwords don't match!");
}
} else {
main::errors("Your current password is incorrect.");
}
} else {
$edit_account_array['DISP'] = "<div style=\"display:none;\">";
main::errors("Details updated!");
}
}
}
echo style::replaceVar("tpl/client/edit-account.tpl", $edit_account_array);
}