<!-- SophiaKnows -->

PHP: BASIC SLIDESHOW
Rev 3: December 2004

<?php
/* --------------------------------- */
/*     SOPHIAKNOWS: PHP LIBRARY      */
/* --------------------------------- */
/*            SLIDESHOW              */
/* --------------------------------- */
/*  Created:  2003-01-01             */
/*  Issued:   2003-01-01             */
/*  Modified: 2004-12-30             */
/*  Component: TEMPLATE              */
/*  Copyright (c) 2003-2004          */
/*  Tony Pisarra, SophiaKnows        */
/* --------------------------------- */
/* --------------------------------- */

/*

This template demonstrates a basic PHP
enabled sequential slide show

*/

// 1. IMAGE SRC LIST

$ImageList=array (
   "images/img1.jpg",
   "images/img2.jpg",
   "images/img3.jpg",
   "images/img4.jpg",
   "images/img5.jpg",
   "images/img6.jpg"
   );         

// 2. LABEL LIST

$LabelList=array (
   "Label 1",
   "Label 2",
   "Label 3",
   "Label 4",
   "Label 5",
   "Label 6"
   );         

// 3. INITIALIZE COUNTER
$indexno=(($indexno)?$indexno:0);

// 4. SET BACK INDEX
$backindex=(($indexno>0)?($indexno-1):(count($ImageList)-1));

// 5. SET NEXT INDEX
$nextindex=(($indexno<(count($ImageList)-1))?($indexno+1):0);

?>
<title>PHP Page</title>
<body links=#000077 vlink=#333337>

<p align=center>
<!-- BACK LINK -->
<a href=?indexno=<?php echo($backindex)?>>&lt; BACK</a>

&nbsp; | &nbsp;

<!-- NEXT LINK -->
<a href=?indexno=<?php echo($nextindex)?>>NEXT &gt;</a>
</p>

<!-- PRINT ACTIVE IMAGE -->
<p align=center><img src="<?php echo($ImageList[$indexno]) ?>" border=0></p>

<!-- PRINT ACTIVE LABEL -->
<p align=center><?php echo($LabelList[$indexno]) ?></p>

</body>

< CODEBASE | TOP^ | MAINPAGE >

Text & Design By Tony Pisarra
© SophiaKnows 1998-2004