Jump to content

[SOLVED] Can someone give me some advice or recomend a different way of doing this


stelthius

Recommended Posts

Ok this is what i need help with, i use these few codes to get info on my server and the visitors ip to display it on the page, problem is you can see it on IE but not in FF am i doing something wrong ?

 

 

 

CODE:

 

 

 

<h2>Technical Informations.</h2>

<center>

Your IP Address :

<?php

$myIP = gethostbyname(trim(`hostname`)); echo $myIP;

?>

 

<?php

$round = 3;// how many decimals after the coma

$m_time = explode(" ",microtime());

$m_time = $m_time[0] + $m_time[1];

$endtime = $m_time;

$totaltime = ($endtime - $starttime);

echo "Page loaded in: ". round($totaltime,$round) ." seconds";

?>

<br><br>

<?php

require_once("class_CPULoad.php");

 

// NOTE: Calling $cpuload->get_load() requires that your webserver has

// write access to the /tmp directory!  If it does not have access, you

// need to edit class_CPULoad.php and change the temporary directory.

$cpuload = new CPULoad();

$cpuload->get_load();

$cpuload->print_load();

 

echo "<br>$cpuload->cached The average CPU load is: ".$cpuload->load["cpu"]."%<br>\n";

 

/*

// This is an alternate way to get the CPU load.  This may return more

// accurate CPU load averages than the previous method (especially if

// your site isn't very busy), but it will cause your script to pause

// for 1 full second while processing.

 

$cpuload = new CPULoad();

$cpuload->sample_load();

$cpuload->print_load();

*/

 

?>

  I just want to say again it works perfectly in IE just shows blank in FF, any ideas hints or sugestions will be much apretiated,

 

 

Thanks Stelth

Link to comment
Share on other sites

i took the Html out mate to make the code i posted on here alot shorter as the Page source is huge/ish

 

 

Ive also compared both source codes and i have also doubled checked everything i asked a friend also to check it in IE and FF he said the same nothing in FF but you can see it in IE Perculiar or a real error im not sure, driving me nuts tho lol

Link to comment
Share on other sites

Your server neither knows nor cares what browser the script output is sent to. All browsers receive the same generated html code.

 

If one browser "works" and the other "doesn't work", then the error lies with the html, not the php.

 

Link to comment
Share on other sites

Ok this is what i dont understand - if you open it up in IE you can clearly see the tech info and then the line of text under nearth it { Above this is were the Tech info is supposed to be! } but if you open it up in firefox its like the Tech info has been completely removed as ->{ Above this is were the Tech info is supposed to be! } displays right under the donate button and forgive me if im wrong but id say this is kinda strange if not totally messed up!, this is how i cant see it being the html script.. is there no way it can just be firefox not wanting to display my php code ?

Link to comment
Share on other sites

AndyB is right. The problem is with your comments. The suggested I gave did work when I tested it. But since there are other comments, it is problem causing some other problems. So, my next suggestion, standardize all your comments. Start then with "<!-- " and end with " -->" (notice the space as well). I recalled reading somewhere if you want more hyphens, you want to keep it as multiples of 4.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.