[原创]获得当前时间的问题,急,请高手帮忙,先谢谢了。 |
目前,我有一个PHP的网页,想在其中输出时间戳,可是还在如果使用echo输出时间,页面中的其他信息就不见了,请哪位高人,给指点一二。
在下面代码中的"//I want to print current datetime"这个位置上我想输出当前时间。
<?
require_once('UserLogin.php');
require_once('UserProfileClass.php');
require_once('common.php');
//̒˹ꐠdefault ·֨¨? display 㷠home =============================
$go=$_REQUEST["go"];
$go_url="";
$id = (isset($_REQUEST["id"]))?$_REQUEST["id"]:0;
$url_map = array(
"photo"=>"$MINIHOME_DOMAIN/home/photo_main.php?id=" . $id,
"diary"=> "$MINIHOME_DOMAIN/home/diary_main.php?id=" .$id,
"room"=> "$MINIHOME_DOMAIN/home/room_main.php?id=" .$id,
"profile"=> "$MINIHOME_DOMAIN/home/profile_main.php?id=" .$id,
"guestbook"=> "$MINIHOME_DOMAIN/home/guestbook_main.php?id=" .$id,
"music"=>"$MINIHOME_DOMAIN/home/music.php?id=" .$id,
"locker"=> "$MINIHOME_DOMAIN/home/locker.php?id=" .$id,
"tool"=> "$MINIHOME_DOMAIN/home/tool_main.php?id=" .$id
);
$go_url = (array_key_exists($go,$url_map))? $url_map[$go]:"$MINIHOME_DOMAIN/home/home_main.php?id=" . $id;
//´֧¢ꎁ Profile ¢˿ user 传¡胣¹ JavaScript =============================
$serviceApi = $TL_SERVICE_DOMAIN."/service/ups/info?id=".$id;
$cache = new Cache();
if($userid != $id){
$userProfile = $cache->getGlobalCache($serviceApi);
}else{
$userProfile = FALSE;
}
if($userProfile==FALSE){
try{
//I want to print current datetime
$doc = getServiceDocument($serviceApi);
$node = $doc->getElementsByTagName('user');
$userProfile = new UserProfile($node);
$cache->setGlobalCache($serviceApi,$userProfile);
}catch(Exception $e){
$cache->close();
$url = $HOME_DOMAIN."/common/url_false.php?code=".$e->getCode()."&detail=".$e->getMessage();
echo '<script type="text/javascript"> window.location = "'.$url.'"</script>';
}
}
$cache->close();
$user_profile = array(
"userid" => $userProfile->userid,
"username" => $userProfile->username,
"displayname" => $userProfile->displayname,
"invite" => $userProfile->invite
);
?>
<html>
<head>
<title>TrueLife: miniHome</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="javascript" type="text/javascript" src="jscripts/wmPlayer.js"></script>
<script language="javascript" type="text/javascript">
function UserProfile(){
this.userid=null;
this.username=null;
this.displayname=null;
}
var userProfile = new UserProfile();
userProfile.userid="<?=$user_profile['userid']?>";
userProfile.username="<?=$user_profile['username']?>";
userProfile.invite="<?=$user_profile['invite']?>";
userProfile.displayname="<?=str_replace("\"",""",$user_profile['displayname'])?>";
window.focus();
</script>
</head>
<frameset rows="0,*,0" border="1" framespacing="0" frameborder="yes" name="minihome">
<frame name="backmusic" frameborder="no" border=0 marginwidth=0 marginheight=0 scrolling=no src="control_mediaplayer.php?id=<?=$id?>">
<frame name="minihome_main" id="minihome_main" frameborder="no" border=0 marginwidth=0 marginheight=0 scrolling=no src="<?=$go_url?>">
<frame name="session" frameborder="no" border=0 marginwidth=0 marginheight=0 scrolling=no src="control_session.php?id=<?=$id?>">
</frameset>
<noframes></noframes>
</html>
|
|
|