<?php
// experimental_peers_drag_and_drop.php
// RJM Programming
// November, 2025
// Make peers of all the experimental drag and drop logic based web applications

 $sofar="";
 $listis='';
 foreach (glob(dirname(__FILE__) . DIRECTORY_SEPARATOR . '*.php') as $filename) {
   $contis=file_get_contents($filename);
   if (strpos($contis, "templa" . "tegame=file_get_contents('./experimental_drag_and_drop.htm") !== false) {
     if (strpos($filename, "_new_") === false && strpos($sofar, str_replace('_','',str_replace($_SERVER['DOCUMENT_ROOT'], '', $filename))) === false) {
     if ($listis == '') {
       $listis.=str_replace($_SERVER['DOCUMENT_ROOT'], '', $filename);
     } else {
       $listis.=',' . str_replace($_SERVER['DOCUMENT_ROOT'], '', $filename);
     }
     $sofar.=str_replace('_','',str_replace($_SERVER['DOCUMENT_ROOT'], '', $filename));
     }
   }
 }
 $larris=explode(',', $listis);
 $htmlis='<html><head><title>Experimental Drag and Drop Peers - RJM Programming - November, 2025</title></head><body><h1>Experimental Drag and Drop Peers</h1><h3>RJM Programming - November, 2025</h3><select onchange="if (this.value.length != 0) { window.open(this.value,' . "'_blank','top=120,left=510,width=940,height=660'" . '); }" id=mysel size=' . (3 + sizeof($larris)) . '><option value="">Optionally select an Experimental Drag and Drop web application, to try, below ...</option><option value="/HTMLCSS/chess_game.php">Chess game</option><option value="/HTMLCSS/gradual_reveal_country_game.htm">Reveal country game</option></select></body></html>';
 
 if ($listis != '') {
    for ($i=0; $i<sizeof($larris); $i++) {
      $htmlis=str_replace('</select>', '<option value="' . $larris[$i] . '">' . strtoupper(substr(str_replace('_',' ',explode('.', basename($larris[$i]))[0]),0,1)) . substr(str_replace('_',' ',explode('.', basename($larris[$i]))[0]),1) . "</option></select>", $htmlis);
    }
    echo $htmlis;
 }
 
 
 ?>