I have a script which has located in /fileupload/index.php. Let's name A. And i want to include a script inside A. Lets name it B. B is located /includes/class/class.product.php
How can i include B inside A using realpath(dirname(FILE)) ?
if A located /index.php I'm including like B like...
require_once realpath(dirname(__FILE__)).'/includes/class/class.product.php';
But main problem is A is located /fileupload/index.php. What should i do ? I don't want to hardcode it. That is why i'm asking.