The Eagle Posted June 1, 2010 Share Posted June 1, 2010 The code below is used to record how many current visitors are on my website, when I have it below it messes up my navigation (ONLY ON IE). Google Chrome and Firefox are fine, I remove the echo [at bottom] and it's fixed. <?php $dataFile = "visitors.txt"; $sessionTime = 100; //this is the time in **minutes** to consider someone online before removing them from our file error_reporting(E_ERROR | E_PARSE); if(!file_exists($dataFile)) { $fp = fopen($dataFile, "w+"); fclose($fp); } $ip = $_SERVER['REMOTE_ADDR']; $users = array(); $onusers = array(); //getting $fp = fopen($dataFile, "r"); flock($fp, LOCK_SH); while(!feof($fp)) { $users[] = rtrim(fgets($fp, 32)); } flock($fp, LOCK_UN); fclose($fp); //cleaning $x = 0; $alreadyIn = FALSE; foreach($users as $key => $data) { list( , $lastvisit) = explode("|", $data); if(time() - $lastvisit >= $sessionTime * 60) { $users[$x] = ""; } else { if(strpos($data, $ip) !== FALSE) { $alreadyIn = TRUE; $users[$x] = "$ip|" . time(); //updating } } $x++; } if($alreadyIn == FALSE) { $users[] = "$ip|" . time(); } //writing $fp = fopen($dataFile, "w+"); flock($fp, LOCK_EX); $i = 0; foreach($users as $single) { if($single != "") { fwrite($fp, $single . "\r\n"); $i++; } } flock($fp, LOCK_UN); fclose($fp); if($uo_keepquiet != TRUE) { // echo '<b>' . $i . ' visitors online</b>'; } ?> What's the problem? Link to comment https://forums.phpfreaks.com/topic/203583-ie-display-error/ Share on other sites More sharing options...
marcus Posted June 1, 2010 Share Posted June 1, 2010 Not a PHP error, just a cross platform error. Check your HTML and CSS. Link to comment https://forums.phpfreaks.com/topic/203583-ie-display-error/#findComment-1066404 Share on other sites More sharing options...
The Eagle Posted June 1, 2010 Author Share Posted June 1, 2010 Erm, yes I figured that out after I posted. I moved it from top of webpage to just above my banner... and it's fixed on all browsers (what I try to aim for) thanks. (http://vazzer.net/) Solved. Link to comment https://forums.phpfreaks.com/topic/203583-ie-display-error/#findComment-1066410 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.