My file structure is here
-www
-myAppDirectory
-init
-connect.php
-products
-api.php
products/api.php file will include the init/connect.php file like following.
<?php
include_once("./connect.php");
users can call api.php from browser.
but it gives warning
Warning: include_once(./connect.php): failed to open stream
I try using this:
include_once($_SERVER["DOCUMENT_ROOT"] . "/connect.php");
but it gives warning,
Warning: include_once(D:\init\www/connect.php): failed to open stream