Posted by Krustov on 02/22/07 23:49
<comp.lang.php>
<>
<22 Feb 2007 05:55:27 -0800>
<1172152527.838122.65930@s48g2000cws.googlegroups.com>
> Is it possible to reference them from a standard text file so that a
> non-techie can login to webedit pro and edit the image name and url
> everytime the ad is being changed ?
>
> The script can be java scrip or preferably PHP, once it can reference
> a .txt file...Im happy
>
It would be quite easy to write a small script that would let you
add/edit the 2 line text file for each rotating banner .
text file 1
images/banner_one.jpg
http://www.yourdomain.com/cgi?=make
text file 2
images/banner_two.jpg
http://www.whatever.com/blah.html
On your actual webpage that uses them - its just a matter of generating
a random number in order to display the banner and use the url that
accompanys it .
Assuming you have 10 banners you want to rotate .....
rnd=(10)
Assuming the above picks 4 as the random number .....
file="banners/4.txt";
read line 1
read line 2
<div> href=url image </div>
I suppose you dont really need to write a suitable script in you create
the text files offline and upload & for the most part you would only
really need to generate a random number and read the 2 lines of text to
be used .
--
www.phptakeaway.co.uk
(work in progress)
[Back to original message]
|