continua.....
non riuscivo a postare tutto in una volta!
File ajax-banner.php
Codice PHP:
<?php
$option = 2;
$reload = 5000;
//parte opzione 1 tagliato
elseif ($option == 2) {
// Simply add the banners you would like to display.
// You can use HTML to display Images - or just plain HTML. You can even put display a form or a flash aplet :)
// You cannot display javascript :(
$banners = array (
'This Is A Text String',
'<h1>Some HTML</h1>',
'[img]banner.gif[/img]',
);
session_start();
if (
!isset($_SESSION['ajax_banner']) // not yet set
||
($_SESSION['ajax_banner'] == count($banners) - 1) // already at the end
) {
$_SESSION['ajax_banner'] = 0; // start from the beginning
} else {
$_SESSION['ajax_banner']++; // increment to the next
}
$html = $banners[$_SESSION['ajax_banner']];
}
// You don't need to edit anything after this point!
// send XML headers
header('Content-type: text/xml');
echo '<?xml version="1.0" ?>';
// print the XML response
?>
<banner>
<content><?php echo htmlentities($html); ?></content>
<reload><?php echo $reload ?></reload>
</banner>