From the PHPToys.com website, there's a simple tutorial that shows you how to create a simple file-based ad rotation script for your website.
In this tutorial I will show you hot to create a simple AD rotator script without using database. The script can display both text and image ads and you can control the number of ads to be displayed at once.
The content (images) are stored in a directory and the heart of the mini-app, the rotation list, is stored in a text-file. All of the code you'll need to get started is included and you can even just download the script if you want to get started right away.