I’m using drupal-6.22, rules-6.x-1.4, and some modules.
With the help of rules module, I’ve set a triggered rule, when the condition happens, it execute custom php code.
The custom PHP print some html like this:
<?php echo '<div><span><a href="whatever">whatever</a></span></div>'; ?>
BUT, the html just appears before the !DOCTYPE html tag, is there any method to place the code wherever I want?
(e.g. <div id="header">HERE!</div>)
I think in this case JS is in need, so I use drupal_add_js($output,'inline'), and called an outside function to place the html, still nothing happens.
I think there must be some method to let PHP insert the output into the current DOM tree, is there any known function or variables for this?
Please help, thanks!!
drupal_set_message() seems to be the right thing for you.