<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Color Dots (Server-Side)</title> <link rel="stylesheet" href="../lit/genstyle.css" type="text/css"> <style> img { border: 0; } .ctr { text-align: center; } </style> </head> <body> <h1 class="ctr">Color Division</h1> <p class="ctr">Click on a dot to move the color division.</p> <div class="ctr" style="white-space: nowrap"> <?php $pos = 15; if(isset($_REQUEST['pos'])) $pos = $_REQUEST['pos']; $imgdir = "/~bennet/dots/"; $me = $_SERVER["PHP_SELF"]; for($i = 0; $i < 30; ++$i) { if($i < $pos) $color = "blue"; else $color = "red"; echo "<a href=\"$me?pos=$i\"><img src=\"$imgdir$color.png\"></a>\n"; } ?> </div> </body> </html>