0

I have this code:

if (file_exists(CHAL_DIR . $row['filename'])) { // Check if the file exists or not.
                         if(!include('' . CHAL_DIR . $row['filename'])) { // Include the Challenge's class file.
                            echo "Include failed.";
                         } else {
                            echo "I win.";
                         }


                    } else {
                         echo "File " . CHAL_DIR . $row['filename'] . " does not exist.";
                    }

But it is not printing any errors? It seems like it just kills the php code after that include? It doesnt even print Include failed.

2 Answers 2

3

It depends on the content of the included file: if it has an exit call or any other sort of termination, then PHP will stop there.

Sign up to request clarification or add additional context in comments.

Comments

2

Have you turned on PHP errors, either for your whole install (via php.ini) or via using:

error_reporting(E_ALL);
ini_set('display_errors', '1');

at the top of your script.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.