Location: PHPKode > scripts > Concurrent Code Rotator > concurrent-code-rotator/test.php
<?php

// Include class definition.
require_once 'ccrotator.class.php';

// File to keep counter information, should have writing permissions.
$counter_file = 'tracker';

// Create class object.
$ccr = new CodeRotator ( $counter_file );

// Add codes to be randomly displayed.
// Work cycle will finish after 2+5+7+3+3=20 exposures.
$ccr->AddCode ( 'b1', '<p>code1</p>', 2 );
$ccr->AddCode ( 'b2', '<p>code2</p>', 5 );
$ccr->AddCode ( 'b3', '<p>code3</p>', 7 );
$ccr->AddCode ( 'b4', '<p>code4</p>', 3 );
$ccr->AddCode ( 'b5', 'includes/code.txt', 3, FROM_FILE );

// Comment next line if you do not want to display debug information.
$ccr->debug_mode = TRUE;

// Display selected code.
$ccr->ShowCode ( );

?>
Return current item: Concurrent Code Rotator