I manage to make it work but i still have the same error for some of this files
PHP Code:
function extract_skilllevel_bin($filename,$output){
global $template ;
global $BinColumnDelimiter ;
global $BinLineEnd ;
$decodedfilecontents = "" ;
$loops = 0 ;
$temp_template = $template ;
unset($temp_template['ID']) ;
$usedTemplate = $template ;
$handle = fopen($filename, "r");
if ($handle) {
foreach ( $template as $ColName=>$Endians) $decodedfilecontents .= $ColName.$BinColumnDelimiter;
$decodedfilecontents .= $BinLineEnd;
while (!feof($handle)) {
$loops++;
if ( $loops % 7 == 1)
$usedTemplate = $template;
else {
$usedTemplate = $temp_template;
$decodedfilecontents .= ' '.$BinColumnDelimiter;
}
$lastLine = '';
foreach ( $usedTemplate as $ColName=>$Endians){
if ( $loops % 7 == 0 && $ColName=='szExplainFileName[128]' ) $Endians = 129;
$hex = bin2hex(fread($handle,$Endians));
if ( $Endians <= 4) {
$val = hexdec(decodehex($hex));
if ( $val == 4294967295 ) $val = -1;
$lastLine.= $val.$BinColumnDelimiter;
} else {
$lastLine.= hex2str($hex).$BinColumnDelimiter;
}
}
if ( ! feof($handle) ) $decodedfilecontents .= $lastLine.$BinLineEnd;
}
fclose($handle);
{
$decodedfile = fopen($output,'w+') ;
fwrite($decodedfile,$decodedfilecontents) ;
fclose($decodedfile) ;
}
}
echo '<h1>'.$output.'</h1>';
echo '<hr />';
print_r($decodedfilecontents);
}
soo i get error on line whit
$handle = fopen($filename, "r"); if you can gyve me aiide abaut what can cause this problem