查看完整版本: 代码学习

Nothing 2007-7-10 09:52

代码学习

[color=#000000][color=#0000cc]<[/color][color=#0000cc]?[/color][color=#0000ff]php[/color]
[color=#ff9900]// 常位于函数文件的开头,禁止在url中直接访问该文件
[/color]
[color=#0000ff]if[/color] [color=#0000cc]([/color][color=#ff0000]eregi[/color][color=#0000cc]([/color][color=#ff00ff]"function.php"[/color][color=#0000cc],[/color][color=#0000ff]$[/color][color=#008080]_SERVER[/color][color=#0000cc][[/color][color=#ff00ff]'PHP_SELF'[/color][color=#0000cc]][/color][color=#0000cc])[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
    [color=#ff0000]Header[/color][color=#0000cc]([/color][color=#ff00ff]"Location: ../index.php"[/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#ff0000]die[/color][color=#0000cc]([/color][color=#0000cc])[/color][color=#0000cc];[/color]
[color=#0000cc]}[/color]


[color=#ff9900]//返回安全字符串

[color=#0000ff]function[/color] getSafeValue[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]value[/color][color=#0000cc])[/color]
[color=#0000cc]{[/color]
    [color=#0000ff]if[/color] [color=#0000cc]([/color][color=#0000cc]![/color] [color=#ff0000]get_magic_quotes_gpc[/color][color=#0000cc]([/color][color=#0000cc])[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
        [color=#0000ff]return[/color] [color=#ff0000]strip_tags[/color][color=#0000cc]([/color][color=#ff0000]addslashes[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]value[/color][color=#0000cc])[/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000cc]}[/color] [color=#0000ff]else[/color] [color=#0000cc]{[/color]
        [color=#0000ff]return[/color] [color=#ff0000]strip_tags[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]value[/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000cc]}[/color]
[color=#0000cc]}[/color]
[color=#ff9900]/*
get_magic_quotes_gpc 函数说明

取得 PHP 环境变量 magic_quotes_gpc 的值。

本函数取得 PHP 环境配置的变量 magic_quotes_gpc (GPC, Get/Post/Cookie) 值。返回 0 表示关闭本功能;返回 1 表示本功能打开。当 magic_quotes_gpc 打开时,所有的 ' (单引号), " (双引号), \ (反斜线) and 空字符会自动转为含有反斜线的溢出字符。

参考资料: [url=http://www.cycoo.net/study/php/function.php-get_magic_quotes_gpc.htm]http://www.cycoo.net/study/php/function.php-get_magic_quotes_gpc.htm[/url]

*/



[color=#ff9900]// 将prefix分成2部分,最后一位数字代表高度使用的CSS样式,其余的部分代表正则Pattern

[color=#ff9900]// 常用于关键字高亮显示

[color=#0000ff]function[/color] highlight[color=#0000cc]([/color][color=#0000cc]&[/color] [color=#0000ff]$[/color][color=#008080]item[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]key[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]prefix[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]   
    [color=#0000ff]$[/color][color=#008080]prefix1[/color] [color=#0000cc]=[/color] [color=#ff0000]preg_quote[/color][color=#0000cc]([/color][color=#ff0000]substr[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]prefix[/color][color=#0000cc],[/color] 0[color=#0000cc],[/color] [color=#ff0000]strlen[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]prefix[/color][color=#0000cc])[/color] [color=#0000cc]-[/color]1[color=#0000cc])[/color][color=#0000cc],[/color] [color=#ff00ff]'/'[/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]prefix2[/color] [color=#0000cc]=[/color] [color=#ff0000]intval[/color][color=#0000cc]([/color][color=#ff0000]substr[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]prefix[/color][color=#0000cc],[/color] [color=#0000cc]-[/color]1[color=#0000cc])[/color][color=#0000cc])[/color][color=#0000cc];[/color]
      [color=#0000ff]$[/color][color=#008080]item[/color] [color=#0000cc]=[/color] [color=#ff0000]preg_replace[/color][color=#0000cc]([/color][color=#ff00ff]"/$prefix1/is"[/color][color=#0000cc],[/color] [color=#ff00ff]"<span class='regSearch$prefix2'>\$0</span>"[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]item[/color][color=#0000cc])[/color][color=#0000cc];[/color]
[color=#0000cc]}[/color]


[color=#ff9900]// 用于URL改写,把url中的问号'?'和与符号'&'改写成斜杆'/'、'+'、','、'-'等字符

[color=#0000ff]function[/color] parse_url_path[color=#0000cc]([/color][color=#0000cc])[/color]
[color=#0000cc]{[/color]
  [color=#ff9900]/* 此方法仅用于apache服务器 */
  [color=#0000ff]if[/color][color=#0000cc]([/color][color=#ff0000]isset[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]_SERVER[/color][color=#0000cc][[/color]PATH_INFO[color=#0000cc]][/color][color=#0000cc])[/color][color=#0000cc])[/color] [color=#0000cc]{[/color][color=#ff9900]//若PATH_INFO可用,注意apache2默认不可用

    [color=#0000ff]$[/color][color=#008080]query_string[/color] [color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]_SERVER[/color][color=#0000cc][[/color]PATH_INFO[color=#0000cc]][/color][color=#0000cc];[/color]
  [color=#0000cc]}[/color] [color=#0000ff]else[/color] [color=#0000cc]{[/color]
    [color=#0000ff]Return[/color] [color=#ff00ff]''[/color][color=#0000cc];[/color]
  [color=#0000cc]}[/color]
  [color=#ff9900]//strip '.html','.htm'

  [color=#0000ff]$[/color][color=#008080]query_string[/color] [color=#0000cc]=[/color] [color=#ff0000]str_replace[/color][color=#0000cc]([/color][color=#ff00ff]'.html'[/color][color=#0000cc],[/color] [color=#ff00ff]''[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]query_string[/color][color=#0000cc])[/color][color=#0000cc];[/color]
  [color=#0000ff]$[/color][color=#008080]query_string[/color] [color=#0000cc]=[/color] [color=#ff0000]str_replace[/color][color=#0000cc]([/color][color=#ff00ff]'.htm'[/color][color=#0000cc],[/color] [color=#ff00ff]''[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]query_string[/color][color=#0000cc])[/color][color=#0000cc];[/color]  
  [color=#0000ff]if[/color][color=#0000cc]([/color][color=#ff0000]empty[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]query_string[/color][color=#0000cc])[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
    [color=#0000ff]Return[/color] [color=#ff00ff]''[/color][color=#0000cc];[/color]
  [color=#0000cc]}[/color] [color=#0000ff]else[/color] [color=#0000cc]{[/color]
    [color=#0000ff]$[/color][color=#008080]args[/color] [color=#0000cc]=[/color] [color=#ff0000]split[/color][color=#0000cc]([/color][color=#ff00ff]"/"[/color][color=#0000cc],[/color] [color=#ff0000]substr[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]query_string[/color][color=#0000cc],[/color]1[color=#0000cc])[/color][color=#0000cc])[/color][color=#0000cc];[/color] [color=#ff9900]//分裂成数组

    [color=#0000ff]Return[/color] [color=#0000ff]$[/color][color=#008080]args[/color][color=#0000cc];[/color]
  [color=#0000cc]}[/color]
[color=#0000cc]}[/color]



[color=#ff9900]//专用函数,只用于将brand按字母排序

[color=#0000ff]function[/color] GroupLetter[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]products[/color][color=#0000cc],[/color][color=#0000ff]$[/color][color=#008080]group[/color][color=#0000cc],[/color][color=#0000ff]$[/color][color=#008080]join[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]categories_name[/color] [color=#0000cc]=[/color] [color=#ff00ff]''[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
  [color=#0000ff]$[/color][color=#008080]out[/color] [color=#0000cc]=[/color] [color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000cc])[/color][color=#0000cc];[/color]
  [color=#0000ff]if[/color][color=#0000cc]([/color][color=#0000cc]![/color] [color=#0000ff]$[/color][color=#008080]products[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
        [color=#0000ff]Return[/color] [color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000cc])[/color][color=#0000cc];[/color]
  [color=#0000cc]}[/color]
  [color=#0000ff]foreach[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]products[/color] [color=#0000ff]as[/color] [color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
    [color=#0000ff]$[/color][color=#008080]key[/color]   [color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]group[/color][color=#0000cc]][/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]value[/color] [color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]join[/color][color=#0000cc]][/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]out[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]key[/color][color=#0000cc]][/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]join[/color][color=#0000cc]][/color][color=#0000cc][[/color][color=#0000cc]][/color] [color=#0000cc]=[/color] [color=#ff00ff]"$value"[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]out[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]key[/color][color=#0000cc]][/color][color=#0000cc][[/color][color=#ff00ff]'models_id'[/color][color=#0000cc]][/color][color=#0000cc][[/color][color=#0000cc]][/color] [color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc][[/color][color=#ff00ff]'models_id'[/color][color=#0000cc]][/color][color=#0000cc];[/color]
  [color=#0000cc]}[/color]
  [color=#0000ff]$[/color][color=#008080]tmp_category_path[/color] [color=#0000cc]=[/color] getCategoryPath[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]categories_name[/color][color=#0000cc])[/color][color=#0000cc];[/color]
  [color=#0000ff]$[/color][color=#008080]filename[/color] [color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]tmp_category_path[/color][color=#0000cc][[/color][color=#ff00ff]'modelsFile'[/color][color=#0000cc]][/color][color=#0000cc];[/color]   
  [color=#0000ff]$[/color][color=#008080]result[/color] [color=#0000cc]=[/color] [color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000cc])[/color][color=#0000cc];[/color]
  [color=#0000ff]foreach[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]out[/color] [color=#0000ff]as[/color] [color=#0000ff]$[/color][color=#008080]k[/color][color=#0000cc]=[/color][color=#0000cc]>[/color][color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
    [color=#ff9900]//定义brand的链接

    [color=#0000ff]$[/color][color=#008080]numBrand[/color] [color=#0000cc]=[/color] [color=#ff0000]count[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]join[/color][color=#0000cc]][/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000ff]for[/color] [color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]i[/color][color=#0000cc]=[/color]0[color=#0000cc];[/color] [color=#0000ff]$[/color][color=#008080]i[/color][color=#0000cc]<[/color][color=#0000ff]$[/color][color=#008080]numBrand[/color][color=#0000cc];[/color] [color=#0000ff]$[/color][color=#008080]i[/color][color=#0000cc]+[/color][color=#0000cc]+[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
        [color=#0000ff]$[/color][color=#008080]href[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]k[/color][color=#0000cc]][/color][color=#0000cc][[/color][color=#0000cc]][/color] [color=#0000cc]=[/color] [color=#ff00ff]"<a href=\""[/color] [color=#0000cc].[/color] [color=#0000ff]$[/color][color=#008080]filename[/color] [color=#0000cc].[/color] [color=#ff00ff]"/"[/color] [color=#0000cc].[/color] convertFileName[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc][[/color][color=#ff00ff]'models_brand'[/color][color=#0000cc]][/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]i[/color][color=#0000cc]][/color][color=#0000cc])[/color] [color=#0000cc].[/color] [color=#ff00ff]'/'[/color] [color=#0000cc].[/color] [color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc][[/color][color=#ff00ff]'models_id'[/color][color=#0000cc]][/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]i[/color][color=#0000cc]][/color] [color=#0000cc].[/color] REWRITE_FILE_EXT2 [color=#0000cc].[/color] [color=#ff00ff]"\" class=\"brand\">"[/color] [color=#0000cc].[/color] [color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]join[/color][color=#0000cc]][/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]i[/color][color=#0000cc]][/color] [color=#0000cc].[/color] [color=#ff00ff]"</a>"[/color][color=#0000cc];[/color]
    [color=#0000cc]}[/color]
    [color=#0000ff]$[/color][color=#008080]result[/color][color=#0000cc][[/color][color=#0000cc]][/color] [color=#0000cc]=[/color] [color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]group[/color] [color=#0000cc]=[/color][color=#0000cc]>[/color] [color=#0000ff]$[/color][color=#008080]k[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]join[/color] [color=#0000cc]=[/color][color=#0000cc]>[/color] [color=#0000ff]$[/color][color=#008080]href[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]k[/color][color=#0000cc]][/color][color=#0000cc])[/color][color=#0000cc];[/color]
   
  [color=#0000cc]}[/color]
  [color=#0000ff]return[/color] [color=#0000ff]$[/color][color=#008080]result[/color][color=#0000cc];[/color]
[color=#0000cc]}[/color]


[color=#ff9900]// 获得字符串的Ascii值

[color=#0000ff]function[/color] AsciiCode[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]name[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
    [color=#0000ff]if[/color][color=#0000cc]([/color][color=#ff0000]empty[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]name[/color][color=#0000cc])[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
        [color=#0000ff]Return[/color] [color=#ff00ff]''[/color][color=#0000cc];[/color]
    [color=#0000cc]}[/color]
    [color=#0000ff]$[/color][color=#008080]name[/color] [color=#0000cc]=[/color] [color=#ff0000]strval[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]name[/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]convert_name[/color] [color=#0000cc]=[/color] [color=#ff00ff]''[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]length[/color] [color=#0000cc]=[/color] [color=#ff0000]strlen[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]name[/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000ff]for[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]i[/color][color=#0000cc]=[/color]0[color=#0000cc];[/color] [color=#0000ff]$[/color][color=#008080]i[/color][color=#0000cc]<[/color][color=#0000ff]$[/color][color=#008080]length[/color][color=#0000cc];[/color] [color=#0000ff]$[/color][color=#008080]i[/color][color=#0000cc]+[/color][color=#0000cc]+[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
        [color=#0000ff]$[/color][color=#008080]convert_name[/color][color=#0000cc][[/color][color=#0000cc]][/color] [color=#0000cc]=[/color] [color=#ff0000]ord[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]name[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]i[/color][color=#0000cc]][/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000cc]}[/color]
    [color=#0000ff]$[/color][color=#008080]name[/color] [color=#0000cc]=[/color] [color=#ff0000]implode[/color][color=#0000cc]([/color][color=#ff00ff]""[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]convert_name[/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000ff]Return[/color] [color=#0000ff]$[/color][color=#008080]name[/color][color=#0000cc];[/color]
[color=#0000cc]}[/color]


[color=#ff9900]// 判断用户是否已经登录

[color=#0000ff]function[/color] checkUser[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]keywords[/color][color=#0000cc])[/color]
[color=#0000cc]{[/color]
  [color=#0000ff]$[/color][color=#008080]key[/color]  [color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]_SERVER[/color][color=#0000cc][[/color][color=#ff00ff]'SERVER_NAME'[/color][color=#0000cc]][/color] [color=#0000cc].[/color] [color=#ff0000]dirname[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]_SERVER[/color][color=#0000cc][[/color][color=#ff00ff]"REQUEST_URI"[/color][color=#0000cc]][/color][color=#0000cc])[/color][color=#0000cc];[/color]
  [color=#0000ff]$[/color][color=#008080]pass[/color] [color=#0000cc]=[/color] [color=#ff0000]crc32[/color][color=#0000cc]([/color][color=#ff0000]md5[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]key[/color][color=#0000cc])[/color][color=#0000cc])[/color][color=#0000cc];[/color]
  [color=#0000ff]$[/color][color=#008080]keywords[/color] [color=#0000cc]=[/color] [color=#ff0000]base64_decode[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]keywords[/color][color=#0000cc])[/color][color=#0000cc];[/color]
  [color=#0000ff]if[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]keywords[/color] [color=#0000cc]=[/color][color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]pass[/color][color=#0000cc])[/color]
  [color=#0000cc]{[/color]
    [color=#0000ff]Return[/color] [color=#0000ff]true[/color][color=#0000cc];[/color]
  [color=#0000cc]}[/color] [color=#0000ff]else[/color]
  [color=#0000cc]{[/color]
      [color=#0000ff]Return[/color] [color=#0000ff]false[/color][color=#0000cc];[/color]
  [color=#0000cc]}[/color]

[color=#0000cc]}[/color]


[color=#ff9900]/**
*此函数对指定的一个二维数组$products中$group进行分类筛选,将相同$group的$join值连接在一起
*@Parameters:$products,$group,$join,其中$products包含了要操作的数据
*@Return:返回一个二维数组$result,数组包括两个键名:$group,$join
*/
[color=#0000ff]function[/color] GroupBrand[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]products[/color][color=#0000cc],[/color][color=#0000ff]$[/color][color=#008080]group[/color][color=#0000cc],[/color][color=#0000ff]$[/color][color=#008080]join[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
  [color=#0000ff]$[/color][color=#008080]out[/color] [color=#0000cc]=[/color] [color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000cc])[/color][color=#0000cc];[/color]
  [color=#0000ff]if[/color][color=#0000cc]([/color][color=#0000cc]![/color] [color=#0000ff]$[/color][color=#008080]products[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
        [color=#0000ff]Return[/color] [color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000cc])[/color][color=#0000cc];[/color]
  [color=#0000cc]}[/color]
  [color=#0000ff]foreach[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]products[/color] [color=#0000ff]as[/color] [color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
    [color=#0000ff]$[/color][color=#008080]key[/color]   [color=#0000cc]=[/color] [color=#ff0000]strtoupper[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]group[/color][color=#0000cc]][/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]value[/color] [color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]join[/color][color=#0000cc]][/color][color=#0000cc];[/color]
    [color=#ff9900]/*
    if(isset($out[$key]))
      $out[$key] .= ", $value";
    else
      $out[$key] = "$value";
   
    */
    [color=#0000ff]$[/color][color=#008080]out[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]key[/color][color=#0000cc]][/color][color=#0000cc][[/color][color=#0000cc]][/color] [color=#0000cc]=[/color] [color=#ff00ff]"$value"[/color][color=#0000cc];[/color]
  [color=#0000cc]}[/color]
  [color=#0000ff]$[/color][color=#008080]result[/color] [color=#0000cc]=[/color] [color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000cc])[/color][color=#0000cc];[/color]
  [color=#0000ff]foreach[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]out[/color] [color=#0000ff]as[/color] [color=#0000ff]$[/color][color=#008080]k[/color][color=#0000cc]=[/color][color=#0000cc]>[/color][color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc])[/color]
    [color=#0000ff]$[/color][color=#008080]result[/color][color=#0000cc][[/color][color=#0000cc]][/color] [color=#0000cc]=[/color] [color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]group[/color] [color=#0000cc]=[/color][color=#0000cc]>[/color] [color=#0000ff]$[/color][color=#008080]k[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]join[/color] [color=#0000cc]=[/color][color=#0000cc]>[/color] [color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc])[/color][color=#0000cc];[/color]

  [color=#0000ff]return[/color] [color=#0000ff]$[/color][color=#008080]result[/color][color=#0000cc];[/color]
[color=#0000cc]}[/color]

[color=#ff9900]/**
* 同上,但以,分隔
*/
[color=#0000ff]function[/color] GroupBrand2[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]products[/color][color=#0000cc],[/color][color=#0000ff]$[/color][color=#008080]group[/color][color=#0000cc],[/color][color=#0000ff]$[/color][color=#008080]join[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
  [color=#0000ff]$[/color][color=#008080]out[/color] [color=#0000cc]=[/color] [color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000cc])[/color][color=#0000cc];[/color]
  [color=#0000ff]if[/color][color=#0000cc]([/color][color=#0000cc]![/color] [color=#0000ff]$[/color][color=#008080]products[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
        [color=#0000ff]Return[/color] [color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000cc])[/color][color=#0000cc];[/color]
  [color=#0000cc]}[/color]
  [color=#0000ff]foreach[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]products[/color] [color=#0000ff]as[/color] [color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
    [color=#0000ff]$[/color][color=#008080]key[/color]   [color=#0000cc]=[/color] [color=#ff0000]strtoupper[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]group[/color][color=#0000cc]][/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]value[/color] [color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]join[/color][color=#0000cc]][/color][color=#0000cc];[/color]
    [color=#0000ff]if[/color][color=#0000cc]([/color][color=#ff0000]isset[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]out[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]key[/color][color=#0000cc]][/color][color=#0000cc])[/color][color=#0000cc])[/color]
      [color=#0000ff]$[/color][color=#008080]out[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]key[/color][color=#0000cc]][/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]",$value"[/color][color=#0000cc];[/color]
    [color=#0000ff]else[/color]
      [color=#0000ff]$[/color][color=#008080]out[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]key[/color][color=#0000cc]][/color] [color=#0000cc]=[/color] [color=#ff00ff]"$value"[/color][color=#0000cc];[/color]
   
  [color=#0000cc]}[/color]
  [color=#0000ff]$[/color][color=#008080]result[/color] [color=#0000cc]=[/color] [color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000cc])[/color][color=#0000cc];[/color]
  [color=#0000ff]foreach[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]out[/color] [color=#0000ff]as[/color] [color=#0000ff]$[/color][color=#008080]k[/color][color=#0000cc]=[/color][color=#0000cc]>[/color][color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc])[/color]
    [color=#0000ff]$[/color][color=#008080]result[/color][color=#0000cc][[/color][color=#0000cc]][/color] [color=#0000cc]=[/color] [color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]group[/color] [color=#0000cc]=[/color][color=#0000cc]>[/color] [color=#0000ff]$[/color][color=#008080]k[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]join[/color] [color=#0000cc]=[/color][color=#0000cc]>[/color] [color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc])[/color][color=#0000cc];[/color]

  [color=#0000ff]return[/color] [color=#0000ff]$[/color][color=#008080]result[/color][color=#0000cc];[/color]
[color=#0000cc]}[/color]

[color=#ff9900]/**
*此函数对指定的一个二维数组$products中$group进行筛选,将相同$group的$join值只留一个
*@Parameters:$products,$group,$join,其中$products包含了要操作的数据
*@Return:返回一个二维数组$result,数组包括两个键名:$group,$join
*/

[color=#0000ff]function[/color] StripRepeated[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]products[/color][color=#0000cc],[/color][color=#0000ff]$[/color][color=#008080]group[/color][color=#0000cc],[/color][color=#0000ff]$[/color][color=#008080]join[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
  [color=#0000ff]$[/color][color=#008080]out[/color] [color=#0000cc]=[/color] [color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000cc])[/color][color=#0000cc];[/color]
  [color=#0000ff]if[/color][color=#0000cc]([/color][color=#0000cc]![/color][color=#0000ff]$[/color][color=#008080]products[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
        [color=#0000ff]Return[/color] [color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000cc])[/color][color=#0000cc];[/color]
  [color=#0000cc]}[/color]
    [color=#0000ff]foreach[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]products[/color] [color=#0000ff]as[/color] [color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
        [color=#0000ff]$[/color][color=#008080]key[/color]   [color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]group[/color][color=#0000cc]][/color][color=#0000cc];[/color]
        [color=#0000ff]$[/color][color=#008080]value[/color] [color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]join[/color][color=#0000cc]][/color][color=#0000cc];[/color]
        [color=#0000ff]if[/color][color=#0000cc]([/color][color=#0000cc]![/color] [color=#ff0000]isset[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]out[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]key[/color][color=#0000cc]][/color][color=#0000cc])[/color][color=#0000cc])[/color]
        [color=#0000cc]{[/color]
            [color=#0000ff]$[/color][color=#008080]out[/color][color=#0000cc][[/color][color=#0000ff]$[/color][color=#008080]key[/color][color=#0000cc]][/color] [color=#0000cc]=[/color] [color=#ff00ff]"$value"[/color][color=#0000cc];[/color]
        [color=#0000cc]}[/color]
    [color=#0000cc]}[/color]
    [color=#0000ff]$[/color][color=#008080]result[/color] [color=#0000cc]=[/color] [color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000ff]foreach[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]out[/color] [color=#0000ff]as[/color] [color=#0000ff]$[/color][color=#008080]k[/color][color=#0000cc]=[/color][color=#0000cc]>[/color][color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc])[/color]
      [color=#0000ff]$[/color][color=#008080]result[/color][color=#0000cc][[/color][color=#0000cc]][/color] [color=#0000cc]=[/color] [color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]group[/color] [color=#0000cc]=[/color][color=#0000cc]>[/color] [color=#0000ff]$[/color][color=#008080]k[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]join[/color] [color=#0000cc]=[/color][color=#0000cc]>[/color] [color=#0000ff]$[/color][color=#008080]v[/color][color=#0000cc])[/color][color=#0000cc];[/color]

    [color=#0000ff]return[/color] [color=#0000ff]$[/color][color=#008080]result[/color][color=#0000cc];[/color]
[color=#0000cc]}[/color]


[color=#ff9900]/**
  * send a mail
  * this function only can send a mail without attachment file
  * it must be support by mimie class
  * @sendtype  => (smtp,mail);
  */
  [color=#0000ff]function[/color] SendMail[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]to[/color] [color=#0000cc]=[/color] SUPPORTER_EMAIL[color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]from[/color] [color=#0000cc]=[/color] [color=#ff00ff]'unnamed'[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]subject[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]message[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]sendtype[/color] [color=#0000cc]=[/color] [color=#ff00ff]'smtp'[/color][color=#0000cc])[/color]
  [color=#0000cc]{[/color]
      [color=#0000ff]global[/color] [color=#0000ff]$[/color][color=#008080]class_mail[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]domain[/color] [color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]_SERVER[/color][color=#0000cc][[/color][color=#ff00ff]'REMOTE_ADDR'[/color][color=#0000cc]][/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]send_date[/color] [color=#0000cc]=[/color] [color=#ff0000]strftime[/color][color=#0000cc]([/color]DATE_FORMAT_LONG[color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]send_time[/color] [color=#0000cc]=[/color] [color=#ff0000]strftime[/color][color=#0000cc]([/color]DATE_TIME_FORMAT[color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000ff]if[/color][color=#0000cc]([/color][color=#ff0000]empty[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]subject[/color][color=#0000cc])[/color] [color=#0000cc]|[/color][color=#0000cc]|[/color] [color=#0000cc]![/color][color=#ff0000]isset[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]subject[/color][color=#0000cc])[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
        [color=#0000ff]$[/color][color=#008080]subject[/color] [color=#0000cc]=[/color] [color=#ff00ff]"a email  from : $domain at "[/color] [color=#0000cc].[/color] [color=#0000ff]$[/color][color=#008080]send_date[/color] [color=#0000cc].[/color] [color=#ff00ff]" "[/color] [color=#0000cc].[/color] [color=#0000ff]$[/color][color=#008080]send_time[/color][color=#0000cc];[/color]
    [color=#0000cc]}[/color]
    [color=#0000ff]$[/color][color=#008080]mailmessage[/color]  [color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]message[/color] [color=#0000cc].[/color] [color=#ff00ff]"<hr>this email is from :"[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]mailmessage[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]domain[/color] [color=#0000cc].[/color] [color=#ff00ff]" at "[/color] [color=#0000cc].[/color] [color=#0000ff]$[/color][color=#008080]send_date[/color] [color=#0000cc].[/color] [color=#ff00ff]" "[/color] [color=#0000cc].[/color] [color=#0000ff]$[/color][color=#008080]send_time[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]text[/color] [color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]mailmessage[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]html[/color] [color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]mailmessage[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]class_mail[/color][color=#0000cc]-[/color][color=#0000cc]>[/color]setHtml[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]html[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]text[/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]class_mail[/color][color=#0000cc]-[/color][color=#0000cc]>[/color]setReturnPath[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]to[/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]class_mail[/color][color=#0000cc]-[/color][color=#0000cc]>[/color]setFrom[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]from[/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]class_mail[/color][color=#0000cc]-[/color][color=#0000cc]>[/color]setBcc[color=#0000cc]([/color]CC_EMAIL[color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]class_mail[/color][color=#0000cc]-[/color][color=#0000cc]>[/color]setSubject[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]subject[/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000ff]$[/color][color=#008080]result[/color] [color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]class_mail[/color][color=#0000cc]-[/color][color=#0000cc]>[/color]send[color=#0000cc]([/color][color=#ff0000]array[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]to[/color][color=#0000cc])[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]sendtype[/color][color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000ff]if[/color] [color=#0000cc]([/color][color=#0000cc]![/color] [color=#0000ff]$[/color][color=#008080]result[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
      Show_Error_Message[color=#0000cc]([/color][color=#ff00ff]"Mail send error"[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]class_mail[/color][color=#0000cc]-[/color][color=#0000cc]>[/color]errors[color=#0000cc])[/color][color=#0000cc];[/color]
    [color=#0000cc]}[/color]
  [color=#0000cc]}[/color]

[color=#ff9900]// Redirect page

[color=#0000ff]function[/color] Redirect_Page[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]url[/color] [color=#0000cc]=[/color] [color=#ff00ff]"/"[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
   [color=#0000ff]$[/color][color=#008080]location[/color][color=#0000cc]=[/color][color=#ff00ff]"<script language=\"javascript\">window.location.href='"[/color] [color=#0000cc].[/color][color=#0000ff]$[/color][color=#008080]url[/color][color=#0000cc].[/color] [color=#ff00ff]"';</script>"[/color][color=#0000cc];[/color]
    [color=#ff0000]echo[/color] [color=#0000ff]$[/color][color=#008080]location[/color][color=#0000cc];[/color]
    [color=#0000ff]return[/color][color=#0000cc];[/color]
[color=#0000cc]}[/color]


[color=#ff9900]// Alert Window Message

[color=#0000ff]function[/color] Alert_Message[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]message[/color] [color=#0000cc]=[/color] [color=#ff00ff]""[/color][color=#0000cc])[/color] [color=#0000cc]{[/color]
   [color=#ff0000]echo[/color] [color=#ff00ff]"<script language=javascript> alert('"[/color] [color=#0000cc].[/color][color=#0000ff]$[/color][color=#008080]message[/color][color=#0000cc].[/color] [color=#ff00ff]"');</script>"[/color][color=#0000cc];[/color]
   [color=#0000ff]return[/color][color=#0000cc];[/color]
[color=#0000cc]}[/color]


[color=#ff9900]//Show user define information in window

[color=#0000ff]function[/color] Show_Message[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]title[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]message[/color][color=#0000cc])[/color]
[color=#0000cc]{[/color]
   [color=#0000ff]$[/color][color=#008080]title[/color] [color=#0000cc]=[/color] [color=#ff0000]htmlspecialchars[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]title[/color][color=#0000cc])[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]message[/color] [color=#0000cc]=[/color] [color=#ff0000]htmlspecialchars[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]message[/color][color=#0000cc])[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]messageTable[/color]  [color=#0000cc]=[/color] [color=#ff00ff]"<table border=\"0\" width=\"80%\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]messageTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<tr>"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]messageTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<td width=\"100%\" height=\"14\" class=\"infoBoxHeading\">"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]messageTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]title[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]messageTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"</td></tr></table>"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]messageTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<table border=\"0\" width=\"80%\" cellspacing=\"0\" cellpadding=\"1\" class=\"infoBox\" align=\"center\">"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]messageTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<tr>"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]messageTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<td><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"infoBoxContents\">"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]messageTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<tr><td><img src=\"/images/pixel_trans.gif\" border=\"0\" width=\"100%\" height=\"1\"></td></tr>"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]messageTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<tr><td align=\"center\" class=\"boxText\">"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]messageTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]message[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]messageTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"</td></tr>"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]messageTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<tr><td><img src=\"/images/pixel_trans.gif\" border=\"0\" width=\"100%\" height=\"1\"></td></tr></table></td></tr></table>"[/color][color=#0000cc];[/color]
   [color=#ff0000]echo[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]messageTable[/color][color=#0000cc])[/color][color=#0000cc];[/color]
   [color=#0000ff]return[/color][color=#0000cc];[/color]
[color=#0000cc]}[/color]


[color=#ff9900]/**
  * Show Error Message and Send a email to the supporter of the website.
  */

[color=#0000ff]function[/color] Show_Error_Message[color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]errorTitle[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]errorMessage[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]errorFile[/color] [color=#0000cc]=[/color] [color=#0000ff]__FILE__[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]errorLine[/color] [color=#0000cc]=[/color] [color=#0000ff]__LINE__[/color][color=#0000cc])[/color]
[color=#0000cc]{[/color]
   [color=#0000ff]$[/color][color=#008080]errorFile[/color]    [color=#0000cc]=[/color] [color=#ff0000]basename[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]errorFile[/color][color=#0000cc])[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTitle[/color]   [color=#0000cc]=[/color] [color=#ff0000]htmlspecialchars[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]errorTitle[/color][color=#0000cc])[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorMessage[/color] [color=#0000cc]=[/color] [color=#ff0000]htmlspecialchars[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]errorMessage[/color][color=#0000cc])[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color]  [color=#0000cc]=[/color] [color=#ff00ff]"<table border=\"0\" width=\"600\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<tr>"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<td width=\"100%\" height=\"14\" style=\"font-family:Verdana, Arial, sans-serif;font-size: 10px;  font-weight: bold;  background: #EBF3E6; color: #000000;\">  "[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#0000ff]$[/color][color=#008080]errorTitle[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"</td></tr></table>"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<table border=\"0\" width=\"600\" cellspacing=\"0\" cellpadding=\"1\" style=\"background: #FFFFFF;  border: 1px solid #EBF3E6;  border-spacing: 0px;\" align=\"center\">"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<tr>"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<td><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"infoBoxContents\">"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<tr><td><img src=\"/images/pixel_trans.gif\" border=\"0\" width=\"100%\" height=\"1\"></td></tr>"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<tr><td align=\"center\" style=\"font: 11px Verdana, Arial, Helvetica, sans-serif;    color: #000000;\">"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<strong>ERROR:</strong> $errorMessage"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<p>Error occurred on line $errorLine of file $errorFile</p>"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<P>An email had sent to the web supporter.</p>"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<P><a href=\"/\"><img src=\"/images/cart/button_continue.gif\" border='0'></a></p>"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"</td></tr>"[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff00ff]"<tr><td><img src=\"/images/pixel_trans.gif\" border=\"0\" width=\"100%\" height=\"1\"></td></tr></table></td></tr></table>"[/color][color=#0000cc];[/color]
   [color=#ff0000]echo[/color][color=#0000cc]([/color][color=#0000ff]$[/color][color=#008080]errorTable[/color][color=#0000cc])[/color][color=#0000cc];[/color]
   [color=#0000ff]$[/color][color=#008080]errorTable[/color] [color=#0000cc].[/color][color=#0000cc]=[/color] [color=#ff0000]sprintf[/color][color=#0000cc]([/color][color=#ff00ff]'<p>%s</p>'[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]_SERVER[/color][color=#0000cc][[/color][color=#ff00ff]"REQUEST_URI"[/color][color=#0000cc]][/color][color=#0000cc])[/color][color=#0000cc];[/color]
   [color=#ff9900]//send mail to supporter

   SendMail[color=#0000cc]([/color]WEBMASTER_EMAIL[color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]_SERVER[/color][color=#0000cc][[/color][color=#ff00ff]'REMOTE_ADDR'[/color][color=#0000cc]][/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]errorTitle[/color][color=#0000cc],[/color] [color=#0000ff]$[/color][color=#008080]errorTable[/color][color=#0000cc])[/color][color=#0000cc];[/color]
   [color=#ff9900]//die();      

[color=#0000cc]}[/color]

[color=#0000cc]?[/color][color=#0000cc]>[/color][/color][/color][/color][/color][/color][/color][/color][/color][/color][/color][/color][/color][/color][/color][/color][/color][/color][/color][/color][/color][/color][/color][/color][/color][/color]
页: [1]
查看完整版本: 代码学习