本文整理匯總了PHP中Md5函數的典型用法代碼示例。如果您正苦於以下問題:PHP Md5函數的具體用法?PHP Md5怎麽用?PHP Md5使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Md5函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: XML_Read
function XML_Read($Object, $Level = 1)
{
#-----------------------------------------------------------------------------
static $Index = 1;
#-----------------------------------------------------------------------------
$Md5 = Md5($Index++);
#-----------------------------------------------------------------------------
$Attribs = $Object->Attribs;
#-----------------------------------------------------------------------------
$Name = isset($Attribs['comment']) ? $Attribs['comment'] : $Object->Name;
#-----------------------------------------------------------------------------
$P = new Tag('P', array('class' => 'NodeName', 'onclick' => SPrintF("TreeSwitch('%s');", $Md5)), new Tag('IMG', array('align' => 'left', 'src' => 'SRC:{Images/Icons/Node.gif}')), new Tag('SPAN', $Name));
#-----------------------------------------------------------------------------
$Node = new Tag('DIV', array('class' => 'Node'), $P);
#-----------------------------------------------------------------------------
if (Count($Attribs)) {
#---------------------------------------------------------------------------
foreach (Array_Keys($Attribs) as $AttribID) {
$Node->AddChild(new Tag('P', array('class' => 'NodeParam'), new Tag('SPAN', SPrintF('%s: ', $AttribID)), new Tag('SPAN', array('class' => 'NodeParam'), $Attribs[$AttribID])));
}
}
#-----------------------------------------------------------------------------
if (Count($Childs = $Object->Childs)) {
#---------------------------------------------------------------------------
$Content = new Tag('DIV', array('style' => 'display:none;'), array('id' => $Md5));
#---------------------------------------------------------------------------
foreach ($Childs as $Child) {
$Content->AddChild(XML_Read($Child, $Level + 1));
}
#---------------------------------------------------------------------------
$Node->AddChild($Content);
}
#-----------------------------------------------------------------------------
return $Node;
}
示例2: Md5
function &Links()
{
#-----------------------------------------------------------------------------
$Name = Md5('Links');
#-----------------------------------------------------------------------------
if (!isset($GLOBALS[$Name])) {
$GLOBALS[$Name] = array();
}
#-----------------------------------------------------------------------------
return $GLOBALS[$Name];
}
示例3: Styles_XML
function Styles_XML($Element)
{
/****************************************************************************/
$__args_types = array('string');
#-----------------------------------------------------------------------------
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
/****************************************************************************/
$CacheID = SPrintF('Styles_XML[%s]', Md5($Element));
#-----------------------------------------------------------------------------
$Result = CacheManager::get($CacheID);
if ($Result) {
return $Result;
}
#-----------------------------------------------------------------------------
$HostsIDs = Styles_HostsIDs($Element);
if (Is_Error($HostsIDs)) {
return ERROR | @Trigger_Error('[Styles_XML]: список хостов содержащих элемент не найдены');
}
#-----------------------------------------------------------------------------
$Result = array();
#-----------------------------------------------------------------------------
foreach (Array_Reverse($HostsIDs) as $HostID) {
#---------------------------------------------------------------------------
$Path = SPrintF('%s/styles/%s/%s', SYSTEM_PATH, $HostID, $Element);
#---------------------------------------------------------------------------
$File = IO_Read($Path);
if (Is_Error($File)) {
return ERROR | @Trigger_Error('[Styles_XML]: не удалось прочитать XML-файл');
}
#---------------------------------------------------------------------------
$XML = String_XML_Parse($File);
if (Is_Exception($XML)) {
return ERROR | @Trigger_Error('[Styles_XML]: не удалось разобрать XML-строку');
}
#---------------------------------------------------------------------------
$Child = Current($XML->Childs);
#---------------------------------------------------------------------------
if (isset($Child->Attribs['recursive'])) {
$Result = array();
}
#---------------------------------------------------------------------------
$Adding = $XML->ToArray();
#---------------------------------------------------------------------------
$Adding = $Adding['XML'];
#---------------------------------------------------------------------------
Array_Union($Result, $Adding);
}
#-----------------------------------------------------------------------------
CacheManager::add($CacheID, $Result);
#-----------------------------------------------------------------------------
return $Result;
}
示例4: encode
/**
* 數據加密
* @param Array 被加密的源數據值
* @return Array 數據加上加完密的值
*/
function encode($vars)
{
if (constant('DEBUG_API')) {
$vars['api_debug'] = 1;
}
ksort($vars);
$verify = '';
foreach ($vars as $key => $v) {
$verify .= $v;
}
$vars['ac'] = Md5($verify . $this->tolken);
return $vars;
}
示例5: Md5
function &Args()
{
#-----------------------------------------------------------------------------
$Name = Md5('Args');
#-----------------------------------------------------------------------------
if (!isset($GLOBALS[$Name])) {
#---------------------------------------------------------------------------
$GLOBALS[$Name] = $_GET;
#---------------------------------------------------------------------------
Array_Union($GLOBALS[$Name], $_POST);
}
#-----------------------------------------------------------------------------
return $GLOBALS[$Name];
}
示例6: Md5
function &Regulars()
{
#-----------------------------------------------------------------------------
$Name = Md5('Regulars');
#-----------------------------------------------------------------------------
if (!isset($GLOBALS[$Name])) {
#---------------------------------------------------------------------------
$GLOBALS[$Name] = System_XML('config/Regulars.xml');
if (Is_Error($GLOBALS[$Name])) {
return ERROR | Trigger_Error('[Regulars]: не удалось загрузить файл регулярных выражений');
}
}
#-----------------------------------------------------------------------------
return $GLOBALS[$Name];
}
示例7: Md5
function &Messages()
{
#-----------------------------------------------------------------------------
$Name = Md5('Messages');
#-----------------------------------------------------------------------------
if (!isset($GLOBALS[$Name])) {
#---------------------------------------------------------------------------
$GLOBALS[$Name] = System_XML('config/Messages.xml');
if (Is_Error($GLOBALS[$Name])) {
return ERROR | Trigger_Error('[Messages]: не удалось загрузить файл сообщений');
}
}
#-----------------------------------------------------------------------------
return $GLOBALS[$Name];
}
示例8: Md5
function &Config()
{
#-------------------------------------------------------------------------------
$Name = Md5('Config');
#-------------------------------------------------------------------------------
if (!isset($GLOBALS[$Name])) {
#-------------------------------------------------------------------------------
$GLOBALS[$Name] = System_XML('config/Config.xml');
if (Is_Error($GLOBALS[$Name])) {
return ERROR | Trigger_Error('[Config]: не удалось загрузить основную конфигурацию');
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return $GLOBALS[$Name];
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
}
示例9: SPrintF
return ERROR | @Trigger_Error(500);
}
#-----------------------------------------------------------------------------
$Lines[] = $Comp;
#-----------------------------------------------------------------------------
$Line[] = SPrintF('%01.2f', $Total);
}
#-------------------------------------------------------------------------------
Array_Splice($Table, 1, 0, array($Lines));
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Tables/Extended', $Table);
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$NoBody->AddChild($Comp);
#-------------------------------------------------------------------------------
$File = SPrintF('%s.jpg', Md5('VPSOrdersPlaning1'));
#-------------------------------------------------------------------------------
Artichow_Line('Планирование поступлений по VPS', SPrintF('%s/%s', $Folder, $File), array($Line), $Labels, array(0x233454));
#-------------------------------------------------------------------------------
$NoBody->AddChild(new Tag('BR'));
#-------------------------------------------------------------------------------
$NoBody->AddChild(new Tag('IMG', array('src' => $File)));
#-------------------------------------------------------------------------------
$Lines = array(new Tag('TD', array('colspan' => 3), 'Общие поступления'));
#-------------------------------------------------------------------------------
$Result['DOM'] = $NoBody;
#-------------------------------------------------------------------------------
return $Result;
#-------------------------------------------------------------------------------
示例10: gException
return ERROR | @Trigger_Error(500);
case 'exception':
return new gException('DOMAIN_ORDER_NOT_FOUND', 'Заказ домена не найден');
case 'array':
break;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
$WhoIs = WhoIs_Check($DomainOrder['DomainName'], $DomainOrder['SchemeName']);
#-------------------------------------------------------------------------------
switch (ValueOf($WhoIs)) {
case 'error':
#-------------------------------------------------------------------------------
# JBS-1150 - сохраняем информацию о домене и ошибке в кэше, при повторе - тупо меняем дату обновления данных whois
$CacheID = Md5(SPrintF('WhoIs-error-%s.%s', $DomainOrder['DomainName'], $DomainOrder['SchemeName']));
#-------------------------------------------------------------------------------
$IsCheck = CacheManager::get($CacheID);
#-------------------------------------------------------------------------------
if ($IsCheck) {
#-------------------------------------------------------------------------------
$IsUpdate = DB_Update('DomainOrders', array('UpdateDate' => Time()), array('ID' => $DomainOrder['ID']));
if (Is_Error($IsUpdate)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Event = array('UserID' => $DomainOrder['UserID'], 'PriorityID' => 'Warning', 'Text' => SPrintF('Повторная ошибка получения данных WhoIs для домена %s.%s, проверка пропущена', $DomainOrder['DomainName'], $DomainOrder['SchemeName']));
#-------------------------------------------------------------------------------
$Event = Comp_Load('Events/EventInsert', $Event);
if (!$Event) {
return ERROR | @Trigger_Error(500);
示例11: array
<?php
#-------------------------------------------------------------------------------
/** @author Alex Keda, for www.host-food.ru */
/******************************************************************************/
/******************************************************************************/
$__args_list = array('Code', 'ID');
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
#Debug("[comp/Services/Orders/ExpirationDateWrapper]: Code = $Code, ID = $ID");
#-------------------------------------------------------------------------------
$CacheID = Md5(SPrintF('%s-%s-%s', $__FILE__, $Code, $ID));
#-------------------------------------------------------------------------------
$Result = CacheManager::get($CacheID);
#-------------------------------------------------------------------------------
if ($Result) {
return $Result;
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if ($Code == 'Default') {
#-------------------------------------------------------------------------------
$Table = "OrdersOwners";
#-------------------------------------------------------------------------------
$Where = SPrintF('`ID` = %u', $ID);
#-------------------------------------------------------------------------------
$CompName = "Formats/Order/ExpirationDate";
#-------------------------------------------------------------------------------
$ColumnName = 'ExpirationDate';
示例12: get_sign
public function get_sign($parameter)
{
ksort($parameter);
$sign = "";
foreach ($parameter as $key => $value) {
$sign .= empty($sign) ? $key . "=" . $value : "&" . $key . "=" . $value;
}
$sign .= "&appKey=" . $this->app_key;
return Md5(Md5($sign));
}
示例13: Comp_Load
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
case 'string':
#---------------------------------------------------
$Comp = Comp_Load('Formats/WorkComplite/Report/Number', $ContractID, $Month);
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------
$Tmp = System_Element('tmp');
if (Is_Error($Tmp)) {
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------
$File = SPrintF('Report%s.pdf', Md5($_SERVER['REMOTE_ADDR']));
#---------------------------------------------------
$IsWrite = IO_Write(SPrintF('%s/files/%s', $Tmp, $File), $PDF, TRUE);
if (Is_Error($IsWrite)) {
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------
$Location = SPrintF('/GetTemp?File=%s&Name=Report%s.pdf&Mime=application/pdf', $File, $Comp);
#---------------------------------------------------
if (!XML_HTTP_REQUEST) {
#-------------------------------------------------
Header(SPrintF('Location: %s', $Location));
#-------------------------------------------------
return TRUE;
}
#---------------------------------------------------
示例14: array
return 'No args...';
}
#-------------------------------------------------------------------------------
$ArgsIDs = array('PAYMENT_ID', 'PAYEE_ACCOUNT', 'PAYMENT_AMOUNT', 'PAYMENT_UNITS', 'PAYMENT_METAL_ID', 'PAYMENT_BATCH_NUM', 'PAYER_ACCOUNT', 'ACTUAL_PAYMENT_OUNCES', 'USD_PER_OUNCE', 'FEEWEIGHT', 'TIMESTAMPGMT', 'V2_HASH');
#-------------------------------------------------------------------------------
foreach ($ArgsIDs as $ArgID) {
$Args[$ArgID] = @$Args[$ArgID];
}
#-------------------------------------------------------------------------------
$Config = Config();
#-------------------------------------------------------------------------------
$Settings = $Config['Invoices']['PaymentSystems']['Egold'];
#-------------------------------------------------------------------------------
$Hash = array($Args['PAYMENT_ID'], $Args['PAYEE_ACCOUNT'], $Args['PAYMENT_AMOUNT'], $Args['PAYMENT_UNITS'], $Args['PAYMENT_METAL_ID'], $Args['PAYMENT_BATCH_NUM'], $Args['PAYER_ACCOUNT'], StrToUpper(Md5($Settings['Hash'])), $Args['ACTUAL_PAYMENT_OUNCES'], $Args['USD_PER_OUNCE'], $Args['FEEWEIGHT'], $Args['TIMESTAMPGMT']);
#-------------------------------------------------------------------------------
$Hash = StrToUpper(Md5(Implode(':', $Hash)));
#-------------------------------------------------------------------------------
if ($Hash != $Args['V2_HASH']) {
return ERROR | @Trigger_Error('[comp/www/Merchant/Egold]: проверка подлинности завершилась не удачей');
}
#-------------------------------------------------------------------------------
$Invoice = DB_Select('Invoices', array('ID', 'Summ'), array('UNIQ', 'ID' => $Args['PAYMENT_ID']));
#-------------------------------------------------------------------------------
switch (ValueOf($Invoice)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
case 'array':
#---------------------------------------------------------------------------
if (Round($Invoice['Summ'] / $Settings['Course'], 2) != $Args['PAYEE_ACCOUNT']) {
示例15: array
}
#-------------------------------------------------------------------------------
$Config = $XML->ToArray();
#-------------------------------------------------------------------------------
$Config = $Config['XML'];
#-------------------------------------------------------------------------------
} else {
#-------------------------------------------------------------------------------
$Config = array();
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (!isset($Config['CSRFKey']) || !$Config['CSRFKey']) {
#-------------------------------------------------------------------------------
$Config['CSRFKey'] = Str_Shuffle(Md5(MicroTime() . Rand(0, 1000000)));
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (isset($Config['Interface']['Notes'])) {
unset($Config['Interface']['Notes']);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (isset($Config['Other']['Libs']['Http'])) {
unset($Config['Other']['Libs']['Http']);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (isset($Config['Users']['Register'])) {