How to set up path for library and include files In Drupal 7, I am writing PHP from inside the Front Page module, say:

$page = include_once "templates/page.php";


I put the "templates/page.php" under /sites/all/modules/front and Drupal complains about file missing. Any suggestion where best to put up the files to be included?

Then, after installing the PHP Simple HTML DOM Parser, I wrote the following

$html = new simple_html_dom();


and was complained for Class 'simple_html_dom' not found. I have tried duplicating the library file to the same folder and home, but all cases not working. How to set up the correct path?

Many thanks.
If it's a theme function, guessing from the file name you mentioned, you should use them theme() function to get the themed output. 

To get the path of a module relative to the Drupal root, use drupal_get_path() function. 

If you want to include or require a file, you can use module_load_include(). However, note that if the including files print anything, they will be printed to the current output buffer (which means they will be printed on user browser). 

Given the above available features, I think it's theme() that you are looking for.