Php failed to read the file ?? $ Dir = opendir (ROOT_PATH. "frame/hack"); while ($ file = readdir ($ dir) {if (is_file (ROOT_PATH. "frame/hack/$ file/data php failed to read the file ??
$ Dir = opendir (ROOT_PATH. "frame/hack ");
While ($ file = readdir ($ dir )){
If (is_file (ROOT_PATH. "frame/hack/$ file/data. SQL ")){
$ SQL = readover (ROOT_PATH. "frame/hack/$ file/data. SQL ");
Preg_match_all ("/insert into 'QB _ hack '([^'] +) \ ('([^'] +) ',' ([^ '] +) '/is ", $ SQL, $ array );
$ _ Array = @ include (ROOT_PATH. "frame/hack/$ file/fix. php ");
If ($ _ array [setup] = 2 ){
$ _ Array [input] = "checked onclick = 'return false '";
} Elseif ($ _ array [setup] = 1 ){
$ _ Array [input] = 'checked ';
}
$ Harray [$ file] = array (
'Name' => implode (',', $ array [3]),
'Input' => $ _ array [input],
);
}
}
// Read and write
Function readover ($ filename, $ method = "rb "){
If ($ handle = @ fopen ($ filename, $ method )){
Flock ($ handle, LOCK_SH );
$ Filedata = fread ($ handle, filesize ($ filename ));
Fclose ($ handle );
}
Return $ filedata;
}
Function writeover ($ filename, $ data, $ method = "rb +", $ iflock = 1 ){
Touch ($ filename );
$ Handle = fopen ($ filename, $ method );
If ($ iflock ){
Flock ($ handle, LOCK_EX );
}
$ Show = fputs ($ handle, $ data );
If ($ method = "rb +") ftruncate ($ handle, strlen ($ data ));
Fclose ($ handle );
Return $ show;
}
The following is the front-end reading format
$ Rs [name]
Why, after the above php run, nothing is displayed. why is there a problem ?? PHP functions
------ Solution --------------------
In linux, check whether the file has the permission to read.
------ Solution --------------------
First, remove @ to suppress the error and see what the error is.