stelthius Posted January 1, 2008 Share Posted January 1, 2008 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 https://forums.phpfreaks.com/topic/83968-solved-can-someone-give-me-some-advice-or-recomend-a-different-way-of-doing-this/ Share on other sites More sharing options...
facets Posted January 1, 2008 Share Posted January 1, 2008 At a quick glance all looks ok. (except you are missing a bunch of HTML) Have you looked at your 'View Source' in both browsers. I'd say this is a HTML error rather than PHP. Will./ Link to comment https://forums.phpfreaks.com/topic/83968-solved-can-someone-give-me-some-advice-or-recomend-a-different-way-of-doing-this/#findComment-427277 Share on other sites More sharing options...
stelthius Posted January 1, 2008 Author Share Posted January 1, 2008 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 https://forums.phpfreaks.com/topic/83968-solved-can-someone-give-me-some-advice-or-recomend-a-different-way-of-doing-this/#findComment-427281 Share on other sites More sharing options...
AndyB Posted January 1, 2008 Share Posted January 1, 2008 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 https://forums.phpfreaks.com/topic/83968-solved-can-someone-give-me-some-advice-or-recomend-a-different-way-of-doing-this/#findComment-427283 Share on other sites More sharing options...
stelthius Posted January 1, 2008 Author Share Posted January 1, 2008 so should i post the full page code and see if anyone can help ? Link to comment https://forums.phpfreaks.com/topic/83968-solved-can-someone-give-me-some-advice-or-recomend-a-different-way-of-doing-this/#findComment-427285 Share on other sites More sharing options...
AndyB Posted January 1, 2008 Share Posted January 1, 2008 Why not just post a link to the live page? Link to comment https://forums.phpfreaks.com/topic/83968-solved-can-someone-give-me-some-advice-or-recomend-a-different-way-of-doing-this/#findComment-427287 Share on other sites More sharing options...
stelthius Posted January 1, 2008 Author Share Posted January 1, 2008 True enough, {link removed} sorry forgot the url redirection, click this its direct to the server {link removed} Link to comment https://forums.phpfreaks.com/topic/83968-solved-can-someone-give-me-some-advice-or-recomend-a-different-way-of-doing-this/#findComment-427288 Share on other sites More sharing options...
duclet Posted January 1, 2008 Share Posted January 1, 2008 Trying changing this line: <!-----------DCODE ENDS/UICODE STARTS HERE------------> to this: <!-----------DCODE ENDS-----------> <!-----------UICODE STARTS HERE------------> Link to comment https://forums.phpfreaks.com/topic/83968-solved-can-someone-give-me-some-advice-or-recomend-a-different-way-of-doing-this/#findComment-427315 Share on other sites More sharing options...
stelthius Posted January 1, 2008 Author Share Posted January 1, 2008 made no difference i thought it wouldnt as ive done many like that before anot had this problem Link to comment https://forums.phpfreaks.com/topic/83968-solved-can-someone-give-me-some-advice-or-recomend-a-different-way-of-doing-this/#findComment-427319 Share on other sites More sharing options...
stelthius Posted January 1, 2008 Author Share Posted January 1, 2008 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 https://forums.phpfreaks.com/topic/83968-solved-can-someone-give-me-some-advice-or-recomend-a-different-way-of-doing-this/#findComment-427323 Share on other sites More sharing options...
AndyB Posted January 1, 2008 Share Posted January 1, 2008 If you replace the comment above the code that doesn't show in FF with <!--DCODE ENDS/UICODE STARTS HERE---> Then it works in FF (at least it does for me). Link to comment https://forums.phpfreaks.com/topic/83968-solved-can-someone-give-me-some-advice-or-recomend-a-different-way-of-doing-this/#findComment-427344 Share on other sites More sharing options...
duclet Posted January 1, 2008 Share Posted January 1, 2008 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 https://forums.phpfreaks.com/topic/83968-solved-can-someone-give-me-some-advice-or-recomend-a-different-way-of-doing-this/#findComment-427353 Share on other sites More sharing options...
stelthius Posted January 1, 2008 Author Share Posted January 1, 2008 ok i have just tried it again it works, maybe i was to impatiaqnt to wait this morning so i just assumed it wasnt working... Anyway thanks guy great help Link to comment https://forums.phpfreaks.com/topic/83968-solved-can-someone-give-me-some-advice-or-recomend-a-different-way-of-doing-this/#findComment-427440 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.