
![]() |
dink
Here is a simple rotate script.
// rotate. php<? php$fcontents = join ('', file ('info.txt')); // the text file can be any name you want $s_con = split("~",$fcontents); $ad_no = rand(0,(count($s_con)-1)); echo $s_con[$ad_no]; ?> The text file: // info.txt <a href="##"><img src="thong.jpg">Standard Thong</a><br /> ~ <a href="##"><img src="p_thong.jpg">Pink Thong</a><br /> ~ <a href="##"><img src="L_thong.jpg">Earl's Thong</a><br /> ~ <a href="##"><img src="s_thong.jpg"> ![]() And finally, the useage: // pink_thongs. php<html> . . . . <p> Before you leave, please see our most recent sales items. Here is a preview of the exciting bargains available. <? include("rotate. php"); ?></p> . . . </html> The rotate script will rotate anything that you have in the text file. It is useful for inserting random strings in dynamic (db) description fields, in meta description fields, and the way I use it the most....different ppc ads on every page load. You should note that you can have multiple rotates on each page. ie, rotate. php, rotate1.php, etc. As long as you have different text files to get your stuff from. Additionally, you can name rotate.phpanything you would like (as long as it doesn't match any other names in your system). The rotate.phpscript above could have been named thongs.phpand it would do the same thing.Dink |

Thread Categories

![]() |
![]() |
Best of The Cache Home |
![]() |
![]() |
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads