xplode( " ", $DATE_TIME_STR );
if ( is_date( $DATE_TIME_ARRY[0] ) && is_time( $DATE_TIME_ARRY ) )
{
return TRUE;
}
return FALSE;
}
?>
auth.php登录验证
复制代码 代码如下:
<?php
/*********************/
/* */
/* Version : 5.1.0 */
/* Author : RM */
/* Comment : 071223 */
/* */
/*********************/
if ( $USER_ID == "" || $PASSWORD == "" )
{
echo "201#|#用户名或密码为空";
exit( );
}
if ( $USER_ID != "OfficeTask" )
{
echo "205#|#用户名错误";
exit( );
}
include_once( "../inc/conn.php" );
include_once( "../inc/utility.php" );
ob_end_clean( );
$query = "select * from EXT_USER where USER_ID=''".$USER_ID."''";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$PWD = $ROW[''PASSWORD''];
$USE_FLAG = $ROW[''USE_FLAG''];
$AUTH_MODULE = $ROW[''AUTH_MODULE''];
$POSTFIX = $ROW[''POSTFIX''];
if ( md5( $PWD ) != $PASSWORD )
{
echo "203#|#密码错误";
exit( );
}
if ( $USE_FLAG == "0" )
{
echo "204#|#帐号已停用";
exit( );
}
}
else
{
echo "202#|#".$USER_ID;
exit( );
}
?>
utility_all公用函数
复制代码 代码如下:
<?php
/*********************/
/* */
/* Version : 5.1.0 */
/* Author : RM */
/* Comment : 071223 */
/* */
/*********************/
function format_date( $STRING1 )
{
$STRING1 = str_replace( "-0", "-", $STRING1 );
$STR = strtok( $STRING1, "-" );
$STRING2 = $STR."年";
$STR = strtok( "-" );
$STRING2 .= $STR."月";
$STR = strtok( " " );
$STRING2 .= $STR."日";
return $STRING2;
}
function format_date_short1( $STRING1 )
{
$STRING1 = str_replace( "-0", "-", $STRING1 );
$STR = strtok( $STRING1, "-" );
$STRING2 = $STR."年";
$STR = strtok( "-" );
$STRING2 .= $STR."月";
return $STRING2;
}
function format_date_short2( $STRING1 )
{
$STRING1 = str_replace( "-0", "-", $STRING1 );
$STR = strtok( $STRING1, "-" );
$STR = strtok( "-" );
$STRING2 .= $STR."月";
$STR = strtok( " " );
$STRING2 .= $STR."日";
return $STRING2;
}
function format_date_short3( $STRING1 )
{
$STRING1 = str_replace( "-0", "-", $STRING1 );
$STR = strtok( $STRING1, "-" );
$STRING2 .= $STR."年";
return $STRING2;
}
function format_date_number( $STRING1 )
{
$STRING1 = str_replace( "-0", "-", $STRING1 );
$STR = strtok( $STRING1, "-" );
$STRING2 = $STR;
$STR = strtok( "-" );
$STRING2 .= strlen( $STR ) == 1 ? "0".$STR : $STR;
$STR = strtok( " " );
$STRING2 .= strlen( $STR ) == 1 ? "0".$STR : $STR;
return $STRING2;
}
function get_week( $STRING )
{
switch ( date( "w", strtotime( $STRING ) ) )
{
case 0 :
return "日";
case 1 :
return "一";
case 2 :
return "二";
case 3 :
return "三";
case 4 :
return "四";
case 5 :
return "五";
case 6 :
return "六";
}
}
function format_money( $STR )
{
if ( $STR == "" )
{
return "";
}
if ( $STR == ".00" )
{
return "0.00";
}
$TOK = strtok( $STR, "." );
if ( strcmp( $STR, $TOK ) == "0" )
{
$STR .= ".00";
}
else
{
$TOK = strtok( "." );
$I = 1;
for ( ; $I <= 2 - strlen( $TOK ); ++$I )
{
$STR .= "0";
}
}
if ( substr( $STR, 0, 1 ) == "." )
{
$STR = "0".$STR;
}
return $STR;
}
function compare_date( $DATE1, $DATE2 )
{
$STR = strtok( $DATE1, "-" );
$Y