Reply to Re: Ad rotation on a website

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация