I need to customize a module and after an if statement check, refresh the page:
So what I need is to refresh the page right after this and print out a success message.
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityWhat you can do is still use Rules for this.
This way, your actions based on an event is configurable just with Rules. This also opens an opportunity to convert your custom code to respond using Rule Events like to trigger the rule after a node is saved and etc.
Update
This is an option to programatically do the above method.