I assume that 'write to the second line' means the same as 'keep the first line and remove everything else' and not 'remove the header from first line, insert the new data as the first line and write the header as the first line again'
// get the first line
// http://stackoverflow.com/questions/4521936/quickest-way-to-read-first-line-from-file
$f = fopen($file, 'r');
$csvHead = fgets($f);
fclose($f);
// your data
$csvData = $ip . "," . $host . "," . $os . "," . $currentDate . "," . $TIME ."\n";
// add your code to the end..
$f = fopen($file,"w");
fwrite($f,$csvHead); // Write information to the file
fwrite($f,$csvData); // Write information to the file
fclose($f); // Close the file
not the nicest of code, but should work, but you only have the latest visitors details.
there are many other, better, solutions for tracking visitors to websites (google analytics?), but you could keep your current script unmodified and check out 'tail for win32' - it lets you monitor files from additions to the bottom http://tailforwin32.sourceforge.net