Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 12-02-2010, 01:10 PM
Contributing Member
Latest Blog:
None

 
Join Date: 09-13-09
Posts: 93
iTrader: 0 / 0%
Why does this only work in firefox? (php)

I have a code that outputs windows server uptime so i can include it on the web to my website, but it seems to only work in firefox which makes me mad >.<
heres the code
Code:
<meta http-equiv="refresh" content="60"> <style type="text/css"> .time { font-size:18px; position: absolute; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); color:#d7d7d7; display: block; border-left: #d7d7d7 1px solid; padding:5px; } </style> <div class="time> <?php class WindowsUptime { const DEFAULT_FILE = 'c:\pagefile.sys'; const DEFAULT_DATE_FORMAT = 'd/M/Y @ H:i'; const RAW_OUTPUT = true; private $file; function __construct($file = self::DEFAULT_FILE) { $this->file = $file; } public function uptime($rawOutput = false) { $uptime = (time() - filemtime($this->file)); if (!$rawOutput) { $days = floor($uptime / (24 * 3600)); $uptime = $uptime - ($days * (24 * 3600)); $hours = floor($uptime / (3600)); $uptime = $uptime - ($hours * (3600)); $minutes = floor($uptime / (60)); $uptime = $uptime - ($minutes * 60); $days = $days.' day'.($days != 1 ? 's' : ''); $hours = $hours.' hour'.($hours != 1 ? 's' : ''); $minutes = $minutes.' minute'.($minutes != 1 ? 's' : ''); $uptime = $days.' '.$hours.' '.$minutes; } return $uptime; } public function upSince($dateFormat = self::DEFAULT_DATE_FORMAT) { return date($dateFormat, filemtime($this->file)); } } $windowsUptime = new WindowsUptime(); echo $windowsUptime->uptime(); // Default output format ?> </div>

thanks
 
Reply With Quote
  #2 (permalink)  
Old 12-02-2010, 03:16 PM
duche's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 11-10-10
Location: Los Angeles, CA
Posts: 96
iTrader: 0 / 0%
PHP code should not make a difference as far as the browser, so your issue is the styling. If you have a site we can look at, it would help in attempting to give you a better solution, but I'd suggest playing around with your css data to make it work in the different browsers. It seems like you have very little css code, so it may not be that big of an issue...
 
Reply With Quote
  #3 (permalink)  
Old 12-02-2010, 03:18 PM
Contributing Member
Latest Blog:
None

 
Join Date: 09-13-09
Posts: 93
iTrader: 0 / 0%
http://69.23.54.163/ is where the data is sent too from my computer (then iframed to the actual site) bt even there it only shows up in firefox..
 
Reply With Quote
  #4 (permalink)  
Old 12-02-2010, 03:22 PM
duche's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 11-10-10
Location: Los Angeles, CA
Posts: 96
iTrader: 0 / 0%
You're missing a " in <div class="time> right after the word time....
 
Reply With Quote
  #5 (permalink)  
Old 12-02-2010, 03:49 PM
Contributing Member
Latest Blog:
None

 
Join Date: 09-13-09
Posts: 93
iTrader: 0 / 0%
*Face-palm* thanks :p
 
Reply With Quote
  #6 (permalink)  
Old 12-02-2010, 06:53 PM
duche's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 11-10-10
Location: Los Angeles, CA
Posts: 96
iTrader: 0 / 0%
You're welcome! Happens to the best of us! That's why it's always good to have someone other than yourself look at the code if you're really stuck...
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tabs dont display corectly in firefox - work fine in IE WorldwideTrading Coding Forum 3 11-19-2008 06:42 AM
Making your firefox browser work as new again krates Tech Talk 4 01-15-2008 02:02 AM
ASP dropdowns won't work in Firefox bookscholarship Web Design Lobby 5 07-29-2006 08:14 PM
ASP dropdowns won't work in Firefox bookscholarship Coding Forum 3 07-29-2006 08:12 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 11:12 AM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.