Reputation: 241
I want include file from another folder. i used different ways but nothing helped me out. One folder back solution and two folders back none gave me any positive respone.
<?php
include_once('./../models/config.php');
?>
Upvotes: 0
Views: 1111
Reputation: 248
Include following lines of code in your file
<?php require_once('../models/config.php'); ?>
Upvotes: 2
Reputation: 1540
The folder where the file is, and the file master.php are in the same folder :
<?php include_once('models/config.php'); ?>
Upvotes: 1
Reputation: 379
How about this:
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'models' . DIRECTORY_SEPARATOR . 'config.php'
Your models directory is in same path as master.php. I recommend always using absolute paths for this kind of things.
Upvotes: 1