22
Feb

Step1: Create a new action for your custom php file in the _menu function in the drupal module file, just like following:

$items['my_php_page'] = array(
'title' => 'Custom PHP Page'',
'page callback' => '_my_php_pager',
'access arguments' => array('access  content'),
'type' => MENU_CALLBACK,
'file' => 'my_php_page.inc.php',
);

Step2: Create ‘my_php_page.inc.php file and create an empty function like following:

function _my_php_page(){
}

Step 3: Paste your custom php script just below the _my_php_page function (below the closing curly brace).

clear the cache and browse the new action. Thats all!

Rajeev Pillai
Posted by on 22 Feb 2010 by Rajeev Pillai in Drupal

2 Responses to “How to include your custom php page in drupal”

Add reply

*