I use a number of scripts on several different web sites. Most of these scripts send out confirmation e-mails and such. In the past, I have been going into the individual CGI files and editing the messages to include ads I wanted to send with the message. I need an easier way to handle getting the ads into the confirmation e-mails.
I wrote a little script myself that I placed in the top of the .CGI files that woudl grab whatever ad I named and stick it in the e-mail. This saved me from having to search through the whole script each time I wanted to change ads. But, I still have to remember to go to several scrips and change the ad every now and again. What I really want is a small script that I can insert into the CGI files that will draw the ads sequentially or randomly from a directory containing all of my ads in text files.. so I only have to stick the script in the .CGI files once and not fool with it again.
I need the script to somehow count the ads in the directory (so I can add and delete ads without having to make changes to the individual .CGI files).
Bottom Line: This script needs to be something I can stick in the top of other scripts that will read advertisements from a directory of text files, and assign the contents of one of the text files (selected either randomly or sequentially) to a variable that I can insert in whatever message is to be sent by the script file in which it is inserted.
It is a very simple project, but one which is beyond my abilities.