I don't understand from the article in what folder do I have to put the php files
Here in the code you see it.
You can set the include path to the folder where you saved your files, without the setting of the include path just enter the correct folder into the "require_once"-statement.
Code:
// Include files outside of webroot
set_include_path('/var/www/surveys/test-survey');
// Fetch database credentials
require_once ('constant.php');
// Connect to database and perform query
require_once ('database.php');