AdRotator Overview
WordPress plugin AdRotator enables you to display an advertisement (which is randomly selected from a group of advertisements specified in a text file) at your chosen location anywhere in your WordPress blog (other free WordPress plugins we provide).

Adding ad code is trvial. You simply add this code in your template, where you want to show the advertisement:
bannerad'); ?>

It searches for the file wp-content/bannerad.txt, chooses one ad randomly from it and displays it. You should replace bannerad with the name of your actual text file without the ending txt extension.
Ref: AdRotator User Manual

How to display rotating ads directly in your WordPress posts or pages?
The key problem is that WordPress doesn't allow php code in your posts and pages. And the code above is php code. The solution is very simple.

You should use any one of the available plugins for this. One such plugin is Priyadi's php-exec. It allows you to execute php code within your posts. To install php-exec follow these simple steps:

  1. Download the plugin: phpexec.txt
  2. Rename the plugin to phpexec.php and put it into your wp-content/plugins directory
  3. Activate the plugin from WordPress administration menu

Now all you have to do is use this code within your WordPress post, to display rotating ads: