PHP:include file -


I have a DB file content that is my DB information. File db.fpp located on my mother's folder [here app folder]. Now, how can I include the db.php file anywhere on the project using base_url () ? Here is my base URL function:

  function base_url () {return "http: // localhost / apps"; }  

I tried this kind but it does not work.

  $ link = base_url (). "/". "Db.php"; ('$ Link');  

Include

>
  ('../db.php');  

"../" will be reapeat in the form of a depth of file (like '../../../db.php') from which you are included

You can also use $ _SERVER ['DOCUMENT_ROOT'] var as the original URL / PATH


Comments