on this page i mentioned i had header errors trying to send cookie
[url]https://webdeveloper.com/forum/showthread.php?t=98565
to solve this i did as suggested and used ip.
i am using a txt file to do store the ip and the time of access.
this is then seperated into an array using split and |
this means i have to sets of data in the array
200603111453 (eg. YYYYMMDDHHMM) and ip
so what i do is use a for loop to search through this
odd numbers being ip and even being time
i do this by adding an extra $i++ under for.
the script is checked to see if ip is the same as current ip and whether the time in the file is more than 5 mins ago.(if more than 5 mins ago unset array[$i]; unset[$array[$i+1]; +1 being the corresponding ip address)
at the end of this the array is imploded…
and the number of users online is printed…this being the valiue of (count($array)/2)
with the contents of file.txt being |YYYYMMDDHHmm|127.0.01 only this is showing as 1.5 not 1 !!! if i add an extra set to this it is at 2.5 (im guessing this will go to 3.5 and 4.5 but can’t garuntee as i only have 2 computers) where is extra .5 coming from???
should i just go -.5 to the value or a round() function or something?