Jump to content

Server Time Zulu time


2old2learn?
 Share

Recommended Posts

Hey I was able to get this to work before on the old script of my web site..but for some reason same style won't work...??Here is a picture of what I am trying to accomplish..servertime.jpgNow here is what I did in the header.php script to get to this point but as you see the time doesn't show just the words..

//Login Block ////////////////////////////////////////////////////////////////////////////////////if (isset($_SESSION["user"])){		$servertime = date("g:i A");	   <<< This get the time		$zulutime = gmdate("j M Hi");	<<< This get the zulu time			$sql = mysql_query("SELECT * FROM `member_groups` WHERE `staff` = 'yes'");		$group = mysql_fetch_array($sql);		$mcredit=mysql_query("SELECT * FROM `credit_member` WHERE memberid = '".$_SESSION['tid']."'");		$mcredit=mysql_fetch_array($mcredit);				// New Private Msg		$query=mysql_query("SELECT COUNT(*) FROM `messages` WHERE `toid`='".$_SESSION['tid']."' AND rcvddel=0  AND `active`='1' AND `grid`='1'");		$newpm=mysql_result($query,0);		// New Invites		$query2=mysql_query("SELECT COUNT(*) FROM `messages` WHERE `toid`='".$_SESSION['tid']."' AND `grid`='2'");		$newin=mysql_result($query2,0);		// New Friends		$query3=mysql_query("SELECT COUNT(*) FROM `friend_requests` WHERE `userid`='".$_SESSION['tid']."'");		$newfriends=mysql_result($query3,0);		// Total Tickets		$query4=mysql_query("SELECT COUNT(*) FROM `tickets` WHERE teamid='".$_SESSION['tid']."' AND `oppid`='None'");		$totalt=mysql_result($query4,0);   if($newfriends == 0)   {	  $currentf="$newfriends " . LANG_FRIEND_INVITES . "";   }   else if($newfriends == 1)   {	  $currentf="<font color='red'><b>$newfriends " . LANG_FRIEND_INVITE . "</b></font>";   }   else   {	  $currentf="<font color='red'><b>$newfriends " . LANG_FRIEND_INVITES . "</b></font>";   }   if($newpm == 0)   {	  $currentm="$newpm " . LANG_UNREAD_MESSAGES . "";   }   else if($newpm == 1)   {	  $currentm="<font color='red'><b>$newpm " . LANG_UNREAD_MESSAGE . "</b></font>";   }   else   {	  $currentm="<font color='red'><b>$newpm " . LANG_UNREAD_MESSAGES . "</b></font>";   }   if($newin == 0)   {	  $currentin="$newin " . LANG_CURRENT_TEAM_INVITES . "";   }   else if($newin == 1)   {	  $currentin="<font color='green'><b>$newin " . LANG_CURRENT_TEAM_INVITE . "</b></font>";   }   else   {	  $currentin="<font color='green'><b>$newin " . LANG_CURRENT_TEAM_INVITES . "</b></font>";   }		if($mcredit[cr] == 0)		{			$credits="<font color='red'><b>0</b></font>";			}else{			$credits="<font color='#00ff00'><b>$mcredit[cr]</b></font>";				}		if($_SESSION['gid'] == $group['id'])		{			$adm="[<a href='./login.php?act=alogin'>Admin Panel</a>] <br />";		}		echo"	  <div class='login-box' align='left'>		 <table align='center'>			<tr>			   <td align='left'>				  <a href='./mailbox.php'>$currentm</a>   <br />				  <a href='./mailbox.php?action=invites'>$currentin</a>   <br />				  <a href='./mailbox.php?action=friends'>$currentf</a>   <br />				  <a href='./ticket.php'>$totalt " . LANG_ACTIVE_TICKETS . "</a>   <br />				  [<a href='./login.php?act=logout'>" . LANG_LOGOUT . "</a>]  <br />			   </td>			   <td align='left'>					$adm				  [<a href='./manager.php?action=manage_profile'>" . LANG_PROFILE_MANAGER . "</a>] <br />				  [<a href='./manager.php?action=manage'><span style='color:#00ff00;' >" . LANG_TEAM_MANAGER . "</span></a>]<br />				  [<a href='./manager.php'><span class='maintext'>" . LANG_MY_PORTAL . "</span></a>]<br />						$credits <b>" . LANG_CREDITS_UC . "</b><br /><span style='color:yellow;'>  >><a href='./shop.php'><span class='maintext'>" . LANG_BUY_MORE_UC . "</span></a><< </span><br />			   </td>			</tr>		 </table>	  </div>";}else{echo"	  <div class='login-box'>		 <form method='post' action='./login.php'>			<table>			   <tr>				  <td>					 <input style='padding-left:3px;' type='text' class='logbox' name='login[name]' id='login-username' value='" . LANG_USERNAME . "' maxlength='20' onClick=\"this.value=''\" AUTOCOMPLETE='off'>				  </td>				  <td>					 <select name='login[clength]' id='login-remember' class='logbut'>						<option value='60'>1 " . LANG_HOUR . "</option>						<option value='1440'>1 " . LANG_DAY . "</option>						<option value='10080'>1 " . LANG_WEEK . "</option>						<option value='43200'>1 " . LANG_MONTH . "</option>						<option value='83200' selected='selected'>" . LANG_FOREVER . "</option>					 </select>					 <input type='hidden' name='act' value='setlogin'>				  </td>			   </tr>			   <tr>				  <td>					 <input style='padding-left:3px;' type='password' class='logbox' name='login[pass]' id='login-password' value='" . LANG_PASSWORD . "' maxlength='20' onFocus=\"this.value=''\" AUTOCOMPLETE='off'></td><td><input src='./theme/gs/images/loginArrow.gif' onclick='this.submit()' type='image' name='submit' alt='" . LANG_GO . "'>    <a href='./login.php'><font color='#000000'><b>" . LANG_FPW . "</b></font></a>				  </td>			   </tr>			   <tr>				  <td align='center' colspan='2'>					 <a href='./register.php'><img src='./theme/gs/images/btnPrimeiraVez.png' alt='" . LANG_JOIN_AND_REGISTER . "' title='" . LANG_JOIN_AND_REGISTER . "' border='0' style='margin:7px 0px 5px 0px;'/></a>				  </td>			   </tr>			</table>		 </form>	  </div>";}//End Login Block////////////////////////////////////////////////////////////////////////////////////////////////////////?>   </div>   <div class="floatMiddle">	  <div class="clr" style="background:#000000; height:1px;"></div>   </div>   <div id="mainHeader">	  <div id="mainHeaderLeft">		 <div id="banner"><? /* <a href="./index.php" title="Home" ><img src="./theme/gs/images/gsLogo.png" alt="Home" border="0" width="392" height="117"/></a> */ ?></div>	  </div>   <!--   <div id="mainHeaderRight"> -->   <!--	  <div id="gsTopRight"><a href="./find.php" title="<? echo "" . LANG_HOME . ""; ?>" ><img src="./theme/gs/images/matchfinder.png" title="<? echo "" . LANG_MATCH_FINDER . ""; ?>" border="0" width="267" height="50"/></a><a href="./challenge.php" title="<? echo "" . LANG_HOME . ""; ?>" ><img src="./theme/gs/images/challenge.png" title="<? echo "" . LANG_CHALLENGE_SECTION . ""; ?>" border="0" width="267" height="50"/></a><a href="./members.php" title="<? echo "" . LANG_HOME . ""; ?>" ><img src="./theme/gs/images/halloffame.png" title="<? echo "" . LANG_HALL_OF_FAME_XP_LEADERBOARD . ""; ?>" border="0" width="267" height="50"/></a></div> ==>  <!--	 </div> -->///below displays the Server Time/Zulu Time<strong><td align='center'><font size='5' font class='catfont'><font color='yellow'>Server Time: $servertime<br><td align='center'><font color='yellow'>Zulu: $zulutime <td><tr>   </div>

I hope I am not becoming too much of a pain..some things I can get and understand and then there are some stuff that just goes over my head..whew...

Edited by 2old2learn?
Link to comment
Share on other sites

You need to tell PHP to print it:Zulu: <?php echo $zulutime; ?>When you're outside of a PHP block you aren't using PHP at all, you're just sending text HTML content.
Ah..thanks bud..
Link to comment
Share on other sites

You need to tell PHP to print it:Zulu: <?php echo $zulutime; ?>When you're outside of a PHP block you aren't using PHP at all, you're just sending text HTML content.
Thanks it worked... :) But it shows the words Server Time / Zulu Time no times displayed until user signs in..Considered Solved!! Edited by 2old2learn?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...