As mentioned by Clive
, You can achieve this by ajax call.
You need to setup page callback under menu hook
in your custom module & there you can mention the function to call on page request.
Example:
// this code will go under menu hook
$items['ajax/rule1.1'] = array(
'title' => 'Rule 1.1',
'page callback' => 'custom_rule_trigger',
'access arguments' => array('access content'),
'file' => 'custom_rules.inc',
);
// then you can write php code which you want to execute under custom_rule_trigger function in custom_rules.inc file.
function custom_rule_trigger(){
// write your rules here..
}
In javascript, you can call www.example.com/ajax/rule1.1
url to trigger your rule.
Hope this will help.