Php failed to read data?

Source: Internet
Author: User
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.

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.