I need a script that rotate my html files, so every click go to difference html file (max 10 html files). Can guys help me? thanks asiong62
// First, build an array of html files $htmlfiles = array ('1.html', '2.html', '3.html', '4.html', '5.html' ); // include one of them randomly include($htmlfiles[rand(0,(count($htmlfiles)-1))]); PHP: - ads2help
ad2help, i'm newbie and i confused about the script. I need compliete script, can you help me? thanks sindyjk
My scripts is complete. Create a php file called whatever.php and paste this inside <?php // First, build an array of html files $htmlfiles = array ('1.html', '2.html', '3.html', '4.html', '5.html' ); // include one of them randomly include($htmlfiles[rand(0,(count($htmlfiles)-1))]); ?> PHP: Edit the 1.html , 2.html, etc.. to the name of your html files. Let your visitor visit yoursite.com/whatever.php and they will see random content everytime. That's all.
u can use this script <?php //entered urls are only examples $urls = array('http://www.examplesite.com/1.html', 'http://www.examplesite.com/2.html', 'http://www.examplesite.com/3.html', 'http://www.examplesite.com/4.html', 'http://www.examplesite.com/5.html'); headers_sent() ? die('<a href="' . $urls[rand(0, count($urls)-1)] . '">Go</a>') : header('Location: ' . $urls[rand(0, count($urls)-1)]); ?> PHP: