关于登录的一个函数,我只想问case2是干什么的,为什么要把登录信息以json
function showMessage($P_message,$P_jumpUrl = '',$P_type = 1,$P_messageType = 'success',$P_time = 2000)
{
if(empty($P_jumpUrl))
{
$P_jumpUrl = getRefUrl();
}
switch ($P_messageType)
{
case 'success':
$L_messageType = '操作成功';
break;
case 'error':
$L_messageType = '操作失败';
break;
case 'warning':
$L_messageType = '操作警告';
break;
}
switch($P_type)
{
case 1:
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
echo 'body { font-family: "Verdana";padding: 0; margin: 0;}';
echo 'h2 { font-size: 12px; line-height: 30px; border-bottom: 1px dashed #CCC; padding-bottom: 8px;width:800px; margin: 20px 0 0 150px;}';
echo 'dl { float: left; display: inline; clear: both; padding: 0; margin: 10px 20px 20px 150px;}';
echo 'dt { font-size: 14px; font-weight: bold; line-height: 40px; color: #333; padding: 0; margin: 0; border-width: 0px;}';
echo 'dd { font-size: 12px; line-height: 40px; color: #333; padding: 0px; margin:0;}';
echo '';
echo '';
echo '';
echo '';
echo ''.$L_messageType.'
';
echo '';
echo ''.$P_message.'';
echo '
';
echo '<a href="'.$P_jumpUrl.'">'.$P_jumpUrl.'';
echo '
';
echo '
';
echo '';
echo '';
echo '';
exit;
break;
case 2:
$L_order_message_array = array();
$L_order_message_array['type'] = $P_messageType;
$L_order_message_array['message'] = $P_message;
$L_order_message_array['refurl'] = $P_jumpUrl;
exit(json_encode($L_order_message_array));
break;
case 3:
$L_order_message_array = array();
$L_order_message_array['type'] = $P_messageType;
$L_order_message_array['message'] = $P_message;
$L_order_message_array['refurl'] = $P_jumpUrl;
print_r(getXml($L_order_message_array));
exit();
break;
case 4:
echo '';
exit;
break;
}
} |
免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。
版权声明:作者保留权利,不代表天盟立场。
|
|
|
|
json返回的原因,是不是因为要做异步的ajax请求用? |
|
|
|
|