0
votes

I am new to drupal, I have created a Drupal 7 module in sites/all/modules/edm

edm.info

name = edm
description = EDM Registration Module
package = EDM API
version = 1.0
core = 7.x
files[] = edm.module

edm.module

<?php
function edm_menu() {
    $items = array();


    $items['edm/send'] = array(
        'title' => 'EDM Registration Module',
        'page callback' => 'perform_curl_request',
        'access arguments' => array('access content'),
        'type' => MENU_CALLBACK,

     );


    return $items;
}


function perform_curl_request() {
   drupal_add_http_header('Content-Type', 'application/json; utf-8');
   echo json_encode(array('result'=>'success','message','Cool! it is working');
}

When i enabled this module for one of the multisite in localhost, works fine. and i did the same for live website by uploading then enabled it. but always redirects to homepage.

the URL i used to access is

http://xxxxxxxxxx/edm/send

is there some configuration i missed or what may be the reason.

1
Have you cleared drupal caches? Also drupal coding standards recommend you prefix module function names with the module name so edm_perform_curl_request() - Scott Anderson

1 Answers

0
votes

For now, It works with following url format. Hope there is an issue with clean URL.

http://domaninnamexxx.com/?q=edm/send

instead of

http://domaninnamexxx.com/edm/send