本文整理汇总了PHP中mymd5函数的典型用法代码示例。如果您正苦于以下问题:PHP mymd5函数的具体用法?PHP mymd5怎么用?PHP mymd5使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mymd5函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: olpay_end
function olpay_end($numcode)
{
global $db, $pre, $webdb, $banktype, $pay_code, $lfjuid;
$pay_code = str_replace('QIBO', '=', $pay_code);
//这个符号“=”容易出问题
if (!$pay_code) {
showerr("数据有误!!");
}
list($type, $atc_moeny, $atc_numcode, $mid, $shopmoney) = explode("\t", mymd5($pay_code, 'DE'));
if ($atc_numcode != intval($numcode)) {
showerr("数据被修改过!!");
}
//主要是针对支付宝不能单纯一位数字的问题,inc/olpay/alipay.php,文件中做了修改
$numcode = str_replace("code", "", $numcode);
//万能表单订单
if ($type == 'form') {
$rt = $db->get_one("SELECT * FROM {$pre}olpay WHERE numcode='{$numcode}' AND `formid`='{$mid}'");
//商城订单
} elseif ($type == 'module') {
$rt = $db->get_one("SELECT * FROM {$pre}olpay WHERE numcode='{$numcode}' AND `moduleid`='{$mid}'");
$db->query("UPDATE {$pre}shoporderuser SET ifpay='1' WHERE id='{$atc_numcode}'");
//奖励积分
if ($shopmoney) {
add_user($lfjuid, $shopmoney, '购买商品得分');
}
}
if (!$rt) {
showerr('系统中没有您的订单,无法完成支付!');
}
if ($rt['ifpay'] == 1) {
showerr('该订单已经支付成功!');
}
$db->query("UPDATE {$pre}olpay SET ifpay='1' WHERE id='{$rt['id']}'");
refreshto("{$webdb['www_url']}/", "恭喜你支付成功", 60);
}
示例2: login
public function login()
{
$username = $this->data['username'];
$password = $this->data['password'];
$row = $this->field('id,username,status,password,salt,total_score')->where(array('username' => $username))->find();
if ($row) {
switch ($row['status']) {
case 2:
$this->error = '未激活!';
return false;
case 0:
case -1:
$this->error = '锁定或删除!';
return false;
}
if ($row['password'] == mymd5($password, $row['salt'])) {
//得到用户的会员价格和折扣
$memberLevel = $this->getMemberLevel($row['total_score']);
$row = array_merge($row, $memberLevel);
return $row;
} else {
$this->error = '密码错误!';
return false;
}
} else {
$this->error = '用户名不存在!';
return false;
}
}
示例3: login
function login()
{
$uname = request('uname');
$passwd = request('passwd');
if (false == ($uname && $passwd)) {
$this->ajaxError('用户名或者密码没有填写');
}
//echo mymd5($passwd);
$user = UserModel::get('', $uname);
if (!$user) {
$this->ajaxError('用户不存在');
}
if ($user['passwd'] != mymd5($passwd)) {
$this->ajaxError('密码不正确');
}
$_SESSION['user'] = $user;
$this->ajaxSuccess($user);
}
示例4: die
} else {
if (!($in = @fopen("php://input", "rb"))) {
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
}
}
while ($buff = fread($in, 4096)) {
fwrite($out, $buff);
}
@fclose($out);
@fclose($in);
// Check if file has been uploaded
if (!$chunks || $chunk == $chunks - 1) {
// Strip the temp .part suffix off
rename("{$filePath}.part", $filePath);
rename($filePath, $uploadPath);
array_push($md5File, mymd5($uploadPath));
$md5File = array_unique($md5File);
file_put_contents('md5list2.txt', join($md5File, "\n"));
}
function mymd5($file)
{
$fragment = 65536;
$rh = fopen($file, 'rb');
$size = filesize($file);
$part1 = fread($rh, $fragment);
fseek($rh, $size - $fragment);
$part2 = fread($rh, $fragment);
fclose($rh);
return md5($part1 . $part2);
}
// Return Success JSON-RPC response
示例5: mymd5
<?php
include "include/function.php";
echo mymd5("aaaaaa", "EN");
示例6: str_replace
}
$rs[nowprice] = str_replace(",", "", $rs[nowprice]);
$totalmoney += $rs[nowprice];
$buydb[$value] = 1;
}
if ($sendType == 'EMS快递') {
$totalmoney += $webdb[ShopEmsSend];
} elseif ($sendType == '其他快递') {
$totalmoney += $webdb[ShopOtherSend];
} elseif ($sendType == '平邮') {
$totalmoney += $webdb[ShopNormalSend];
}
$db->query("UPDATE `{$pre}shoporderuser` SET `totalmoney`='{$totalmoney}' WHERE id='{$orderid}'");
setcookie("buyid", '');
if ($payType == '在线支付' && $totalmoney > 0) {
$pay_code = str_replace('+', '%2B', mymd5("module\t{$totalmoney}\t{$orderid}\t{$rs['mid']}\t{$shopmoney}"));
echo "<META HTTP-EQUIV=REFRESH CONTENT='0;URL={$webdb['www_url']}/do/olpay.php?pay_code={$pay_code}'>";
exit;
}
echo '<meta http-equiv="Content-Type" content="text/html; charset=gb2312">';
die("<CENTER>恭喜你,订单提交成功,请劳记你的订单号,方便查询,你的订单号是:<font color=red>{$orderid}</font><br><br><A HREF='{$webdb['www_url']}/'>点击返回首页</A></CENTER>");
}
$detail = explode(",", $buyid);
foreach ($detail as $key => $value) {
if (!is_numeric($value)) {
unset($detail[$key]);
}
$numdb[$value]++;
}
$fids = implode(",", $detail);
$totalmoney = 0;
示例7: mymd5
';
include "../include/conn.php";
include "../include/function.php";
if ($action == "changepass") {
$hint = "";
if (trim($pwd1) == "") {
$hint .= "请输入密码\\n";
}
if ($pwd2 != $pwd1) {
$hint .= "两次密码不一致\\n";
}
if ($hint != "") {
echo "<script>alert('" . $hint . "');history.back();</script>";
exit;
}
$sql = "update {$db_prefix}admin set pwd='" . mymd5($pwd1, "EN") . "' where id='" . $_SESSION["glo_adminid"] . "'";
$db->query($sql);
echo "<script>alert('密码已修改');location.href='changepass.php';</script>";
exit;
}
echo '</HEAD><body>
<form name="form1" method="post" action="?action=changepass">
<br>
<TABLE width="421" border=0 align="center" cellPadding=0 cellSpacing=0 class=Table_xt>
<TBODY>
<TR><TD width="421" colSpan=4>
<TABLE cellSpacing=0 cellPadding=0 width="100%" background="images/tab_05.gif"><TBODY><TR>
<TD width=213 height=23> <strong>密码修改</strong></TD>
<TD > </TD>
</TR></TBODY></TABLE>
示例8: edit
public function edit($id = '')
{
if (!$id) {
$id = request('id');
}
if (isset($_POST['id'])) {
$uname = request('uname');
$user = UserModel::get('', $uname);
if ($user && $user['id'] != $id) {
$this->error('用户名重复');
}
$passwd = request('passwd');
if ($passwd) {
if ($passwd != request('passwd2')) {
$this->error('两次输入的密码不一致');
}
$data['passwd'] = mymd5($passwd);
}
if ($GLOBALS['method'] != 'my') {
$data['group_id'] = request('group_id');
$data['department_id'] = request('department_id');
}
$data['alias'] = request('alias');
$data['uname'] = request('uname');
$data['phone'] = request('phone');
if (UserModel::update($id, $data)) {
$this->success(request('reffer'));
} else {
$this->error('更新失败');
}
} else {
$user = UserModel::get($id);
if (!$user) {
$this->error('用户不存在');
}
$this->assign('user', $user);
$this->display('user_edit');
}
}
示例9: set_cookie
//注册时间间隔处理
if ($webdb[limitRegTime]) {
set_cookie("limitRegTime", 1, $webdb[limitRegTime] * 60);
}
//注册用户自定义字段
Reg_memberdata_field($uid, $postdb);
//通行证处理
if ($_COOKIE[passport_url] || $_POST[passport_url]) {
$passport_url = urldecode($_COOKIE[passport_url] ? $_COOKIE[passport_url] : $_POST[passport_url]);
setcookie('passport_url', '');
$userDB->passport_server($username, $passport_url);
}
$jumpto && ($jumpto = urldecode($jumpto));
add_user($uid, $webdb[regmoney], '注册得分');
//捆绑QQ帐号
list($token, $secret, $openid) = explode("\t", mymd5(get_cookie('token_secret'), 'DE'));
if ($openid) {
$rs1 = $db->get_one("SELECT * FROM {$pre}memberdata WHERE `qq_api`='{$openid}'");
if (!$rs1) {
$db->query("UPDATE {$pre}memberdata SET `qq_api`='{$openid}' WHERE username='{$username}'");
refreshto("{$webdb['www_url']}", "帐号捆绑成功!!", 1);
}
}
if (strstr($jumpto, $webdb[www_url])) {
refreshto("{$jumpto}", "恭喜你,注册成功", 1);
} else {
refreshto("{$webdb['www_url']}", "恭喜你,注册成功", 1);
}
} else {
//通行证处理
if ($_GET[passport_url]) {
示例10: session_start
echo '<HTML><HEAD><title></title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/images/datalist.css" type="text/css">
';
include "../include/conn_2.php";
include "../include/function.php";
session_start();
if ($action == "secpwd") {
$hint = "";
if ($pwd1 != $re_pwd1) {
$hint .= "Different entering\\";
}
if ($hint != "") {
echo "<script>alert('" . $hint . "');history.back();</script>";
exit;
}
$sql_1 = "select * from {$db_prefix}users where username='" . $_SESSION["glo_username"] . "' and pwd1='" . mymd5($pwd1, "EN") . "'";
$rs_1 = $db->get_one($sql_1);
if (empty($rs_1["id"])) {
echo "<script>alert('Fail to confirm');history.back();</script>";
exit;
}
$_SESSION["glo_usersecpwd"] = $rs_1["pwd1"];
header("location:{$fromurl1}");
exit;
}
echo '</HEAD><body>
<form name="form1" method="post" action="?action=secpwd">
<br>
<TABLE width="600" border=0 align="center" cellPadding=0 cellSpacing=0 class=Table_xt>
<TBODY>
示例11: passport_server
function passport_server($username, $url)
{
global $WEBURL;
if (eregi("^{$WEBURL}", $url)) {
showerr("网址有误!");
}
if (!strstr($url, '?')) {
$url .= '?';
} else {
$url .= '&';
}
$rs = $this->get_allInfo($username, 'name');
$md5code = "uid={$rs['uid']}&username={$rs['username']}&password={$rs['password']}&email={$rs['email']}";
$md5code = urlencode(mymd5($md5code));
echo "<META HTTP-EQUIV=REFRESH CONTENT='0;URL={$url}md5code={$md5code}'>";
exit;
}
示例12: testMyMd5
function testMyMd5()
{
$md5 = mymd5("impxl");
my_log($md5);
my_log(mymd5($md5, "DE"));
}
示例13: unset
unset($_ENV, $HTTP_COOKIE, $HTTP_ENV_VARS, $_REQUEST, $HTTP_POST_VARS, $HTTP_GET_VARS, $HTTP_POST_FILES, $HTTP_COOKIE_VARS);
$db = new MYSQL_DB();
unset($web_admin, $sort_admin, $lfjid, $lfjuid, $lfjpwd, $lfjdb, $groupdb);
$usr_oltime = intval($usr_oltime);
/*用户登录模块*/
if ($webdb[passport_type] && is_file(ROOT_PATH . "inc/passport/{$webdb[passport_type]}.php")) {
require_once ROOT_PATH . "inc/passport/{$webdb[passport_type]}.php";
$userDB = new qb_user();
$lfjdb = PassportUserdb();
} else {
$TB = array("table" => "{$pre}members", "uid" => "uid", "username" => "username", "password" => "password");
$userDB = new qb_user();
$lfjdb = $userDB->login_info();
}
//同步后台登录
if ($_COOKIE["adminID"] && ($detail = mymd5($_COOKIE["adminID"], 'DE', $onlineip))) {
unset($_uid, $_username, $_password);
list($_uid, $_username, $_password) = explode("\t", $detail);
$lfjdb = $db->get_one("SELECT * FROM {$pre}memberdata WHERE uid='{$_uid}' AND username='{$_username}'");
}
if ($lfjdb[yz]) {
$lfjid = $lfjdb['username'];
$lfjuid = $lfjdb['uid'];
$lfjdb[icon] && ($lfjdb[icon] = tempdir($lfjdb[icon]));
if ($lfjdb['groupid'] == 3 || $lfjdb['groupid'] == 4) {
$web_admin = $sort_admin = '1';
}
if (file_exists(ROOT_PATH . "data/group/{$lfjdb[groupid]}.php")) {
$groupdb = @(include ROOT_PATH . "data/group/{$lfjdb[groupid]}.php");
} else {
$lfjdb['groupid'] = 8;
示例14: unset
unset($sqldb);
$sqldb['id'] = "id='{$id}'";
$sqldb['uid'] = "uid='{$lfjuid}'";
/*检查判断辅信息表要插入哪些字段的内容*/
$array = table_field("{$_pre}content_{$fidDB['id']}");
foreach ($array as $key => $value) {
if ($value == "id" || $value == "uid") {
continue;
}
isset($postdb[$value]) && ($sqldb["{$value}"] = "`{$value}`='{$postdb[$value]}'");
}
$sql = implode(",", $sqldb);
$db->query("INSERT INTO `{$_pre}content_{$fidDB['id']}` SET {$sql}");
//在线支付
if ($postdb[paytype] == 'olpay' && $postdb[paymoney] > 0) {
$pay_code = str_replace('+', '%2B', mymd5("form\t{$postdb['paymoney']}\t{$id}\t{$mid}"));
echo "<META HTTP-EQUIV=REFRESH CONTENT='0;URL={$webdb['www_url']}/do/olpay.php?pay_code={$pay_code}'>";
exit;
}
refreshto("/", "表单提交成功 ", 5);
} elseif ($job == "edit") {
$rsdb = $db->get_one("SELECT A.*,B.* FROM `{$_pre}content` A LEFT JOIN `{$_pre}content_{$fidDB['id']}` B ON A.id=B.id WHERE A.id='{$id}'");
if ($rsdb[uid] != $lfjuid && !$web_admin) {
showerr("你无权修改");
}
/*对附件地址作还原*/
foreach ($m_config[is_html] as $key => $value) {
$rsdb[$key] = editor_replace($rsdb[$key]);
$rsdb[$key] = En_TruePath($rsdb[$key], 0);
}
/*表单默认变量作处理*/
示例15: dirname
<?php
require dirname(__FILE__) . "/" . 'global.php';
if ($_POST) {
if (!ereg("^[0-9a-z_]+\$", $dir)) {
$dir = "other";
}
$array[name] = is_array($Filedata) ? $_FILES[Filedata][name] : $Filedata_name;
$array[path] = $webdb[updir] . "/" . $dir;
$array[size] = is_array($Filedata) ? $_FILES[Filedata][size] : $Filedata_size;
$array[updateTable] = 1;
//统计用户上传的文件占用空间大小
list($lfjid, $lfjuid) = explode("\t", mymd5($_POST[str], 'DE'));
$filename = upfile(is_array($Filedata) ? $_FILES[Filedata][tmp_name] : $Filedata, $array);
/*
ob_end_clean();
ob_start();
print_r($_POST);
$c=ob_get_contents();ob_end_clean();
write_file('a.txt',$c);
*/
if (!$filename) {
echo "";
} else {
$newfile = "{$dir}/{$filename}";
echo "{$newfile}|{$array['name']}|{$array['size']}";
}
}