http://pastebin.com/VHM3QeYW
Code: Select all
<?php
include("scan_ips_class.php");
$scanIPs = new Scan_ips;
?>Code: Select all
$fh = @fopen($this->file,"r+b");
...
fseek ( $fh , $i );
...
$byte = fread($fh,1);
...
if ( $byte === "\x00" ){
fseek($fh, $i );
echo "<h1>$i</h1>";
fwrite($fh, chr($arr[0]), 1);
echo "<h1>".($i+$this->rowLength)."</h1>";
fseek($fh, $i+$this->rowLength );
echo "<h1>".($i+2*$this->rowLength)."</h1>";
fwrite($fh, chr($arr[1]), 1);
$result = fseek($fh, $i+2*$this->rowLength );
if ( $result !== 0)
die("Error while looking for last position: " . ($i+2*$this->rowLength) . "
; result $result");
die(); // stop because some bug is here which corrupts the file
fwrite($fh, chr($arr[2]), 1);
fclose ($fh);
echo "close and exit";
break;
}
