Ju-Pao Posted February 21, 2007 Share Posted February 21, 2007 Is there a way in PHP to use the define function from another file in another directory in your PHP code? For example my code is in this directory /home/dirA/dirB/dirC/ the the define function was from the directory /home/dirA/ define('KEYWORD',boi); how can i use it in my code so that if I echo KEYWORD, it will display boi without putting the define function in my code. thank you guys for your help Quote Link to comment Share on other sites More sharing options...
scottybwoy Posted February 21, 2007 Share Posted February 21, 2007 What you need to incorporate here is classes, you can have all your defined functions stored in a few scripts/directories then call them at will. It's too big a topic to explain in one forum post, so what I suggest is that you look for a few tutorials / explanations on the net good luck Quote Link to comment Share on other sites More sharing options...
Ju-Pao Posted February 22, 2007 Author Share Posted February 22, 2007 thanks for the suggestion scotty Quote Link to comment Share on other sites More sharing options...
Ju-Pao Posted February 22, 2007 Author Share Posted February 22, 2007 sorry to double post, but can anyone help me on how to include a file that is on a different directory? Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 22, 2007 Share Posted February 22, 2007 include('dir/file.php'); Quote Link to comment Share on other sites More sharing options...
Ju-Pao Posted February 22, 2007 Author Share Posted February 22, 2007 wow, thanks jesirose i never thought it was that simple Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.