A simple ad rotation program written in php, which uses a simple text file to revolve your ads. No need to get any databaseor CGI scripting.
Title: A simple ad rotation program written in php, which uses a simple text file to revolve your ads. No need to get any databaseor CGI scripting.
Category: /Science & Technology/Computers and Cybernetics
Details: Words: 372 | Pages: 1 (approximately 235 words/page)
A simple ad rotation program written in php, which uses a simple text file to revolve your ads. No need to get any databaseor CGI scripting.
Category: /Science & Technology/Computers and Cybernetics
Details: Words: 372 | Pages: 1 (approximately 235 words/page)
A simple ad rotation program written in php, which uses a simple text file to revolve your ads. No need to get any databaseor CGI scripting. You canalso use this concept to revolve contents on your site.
<?php
/*
Author : Syed R Fayyaz
Comments : There are many ad rotating scripts out there
most of them are in Java, I wanted to have this done in PHP.
Here is a simple script to revolve your
showed first 75 words of 372 total
You are viewing only a small portion of the paper.
Please login or register to access the full copy.
Please login or register to access the full copy.
showed last 75 words of 372 total
your text file
$fcontents = join ('', file ('textfile.txt'));
//Spliting contents of file by looking for ~ mark between codes
//and storing everything into an array.
$s_con = split("~",$fcontents);
//getting a random number which will be within the limit of the
//contents of the file, means if 5 different banners/ads then the number
//will be between 0-4 (total 5 )
$banner_no = (rand()%(count($s_con)-1));
//simple scho banner
echo $s_con[$banner_no];
?>