Welcome Guest, Not a member yet? Register   Sign In
fwrite() being screwy
#5

[eluser]Kepler[/eluser]
The only other thing I can think of is that the code section is being called twice. Try adding a counter to see if the 2 "TEST"s are actually separate calls:

Code:
if (($counter = $this->session->userdata('counter')) === false)
{
    $counter = 0;
}
$msg = 'TEST'.$counter;
$fp = fopen('./logs/somefile.php','ab');

flock($fp, LOCK_EX);    
fwrite($fp, $msg);
flock($fp, LOCK_UN);
fclose($fp);
$this->session->set_userdata('counter', ($counter + 1));

If your file contains:

TEST0TEST1

then you are calling that section of code twice. If the file contains:

TEST0TEST0

then you are back to where you started.


Messages In This Thread
fwrite() being screwy - by El Forum - 02-20-2010, 02:37 PM
fwrite() being screwy - by El Forum - 02-20-2010, 06:14 PM
fwrite() being screwy - by El Forum - 02-20-2010, 10:04 PM
fwrite() being screwy - by El Forum - 02-21-2010, 12:16 PM
fwrite() being screwy - by El Forum - 02-21-2010, 01:58 PM
fwrite() being screwy - by El Forum - 02-21-2010, 06:11 PM
fwrite() being screwy - by El Forum - 02-21-2010, 06:25 PM
fwrite() being screwy - by El Forum - 02-21-2010, 11:05 PM
fwrite() being screwy - by El Forum - 02-21-2010, 11:14 PM
fwrite() being screwy - by El Forum - 02-21-2010, 11:23 PM
fwrite() being screwy - by El Forum - 02-22-2010, 12:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB