本文整理匯總了PHP中Crypt::en方法的典型用法代碼示例。如果您正苦於以下問題:PHP Crypt::en方法的具體用法?PHP Crypt::en怎麽用?PHP Crypt::en使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Crypt
的用法示例。
在下文中一共展示了Crypt::en方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: encrypt
function encrypt($id, $prefix = "JHC", $clear = false)
{
$crypt = new \Crypt();
$x = $prefix . $crypt->en(intval($id));
if (!$clear) {
return $x;
}
if (strpos($x, '=') !== false || strpos($x, '-') !== false) {
// PLog::write("Not a problem: Try again for no '= or -' in encrypt string", "INFO");
return encrypt_id($id, $prefix, $clear);
} else {
return $x;
}
}
示例2: encrypt_id
static function encrypt_id($id, $prefix = "CYD")
{
return $prefix . Crypt::en(intval($id));
}
示例3: encrypt_id
function encrypt_id($id, $prefix = "XSZZ")
{
return $prefix . Crypt::en($id);
}
示例4: foreach
?>
<?php
if (count($archives) > 1) {
?>
<div>
<i class="icon-briefcase"></i>申請表提交記錄存檔
<?php
if (is_array($archives)) {
foreach ($archives as $key => $one) {
echo ++$idx;
?>
. <a href="<?php
echo D('Options')->getOption('webroot_apply');
?>
/userinfo/preview?token=<?php
echo Crypt::en($user['userinfo']['id']);
?>
&archive_id=<?php
echo $key;
?>
" target="_blank"><?php
echo substr($one, 0, 16);
?>
</a> <?php
}
}
?>
</div><?php
}
?>
示例5: submit_forget_password
public function submit_forget_password()
{
$email = $this->_param("email");
if (!Utility::CaptchaCheck($this->_post('verifycode'))) {
Session::Set("error", "驗證碼有誤,請重新輸入");
redirect("/register/forget_password");
}
if ($email) {
$user = D("CmsUsers")->where(array("email" => $email))->find();
if ($user) {
$subject = D("Options")->getOption("verify_email_subject");
$repasscode = md5(generate_password());
D("CmsUsers")->where(array('id' => $user['id']))->setField("repasscode", $repasscode);
$link = D("Options")->getOption("webroot_apply") . "/register/verify_repass?id=" . Crypt::en($user['id']) . "&repasscode={$repasscode}";
$link = "<a href='{$link}'>" . $link . "</a>";
$subject = D("Options")->getOption("repass_email_subject");
$content = D("Options")->getOption("repass_email_content");
$content = str_replace("[#link#]", $link, $content);
Mailer::SmtpMail(null, $email, $subject, $content);
redirect("/register/submit_forget_password_result?token=" . Crypt::en($email));
} else {
Session::Set("error", "無此郵箱");
redirect("/register/forget_password");
}
} else {
Session::Set("error", "無此郵箱");
redirect("/register/forget_password");
}
}
示例6: encrypt_id
function encrypt_id($id)
{
return 'JXD' . Crypt::en(intval($id));
}