Here is the great way to detect bugs on your php script.This done by writing all outputs of the code to log file. It is very handy when you can't echo to the screen. Below shows how you can do it.
1.Create a file named log.txt in your root directory or other place you like.
2.Type the following code covering codes that you wish to debug.
        $fp = fopen("log.txt", "a+");
        ob_start();
        //put your code which is to be debugged here
        
        $content = ob_get_contents();
        ob_end_clean();
        fwrite($fp, $content);
        fclose($fp);
3.Next run the code and see the log.txt to check output and find where is the bug.
If you need any kind of help put a comment here.
Have fun with this.  eeesY
No comments:
Post a Comment