I:\wamp3.64\www\index.php I:\wamp3.64\www\index_3.2.7.php
<?php <?php
   
// Page created by Shepard [Fabian Pijcke] <Shepard8@laposte.net> // Page created by Shepard [Fabian Pijcke] <Shepard8@laposte.net>
// Arno Esterhuizen <arno.esterhuizen@gmail.com> // Arno Esterhuizen <arno.esterhuizen@gmail.com>
// and Romain Bourdon <rromain@romainbourdon.com> // and Romain Bourdon <rromain@romainbourdon.com>
// and Hervé Leclerc <herve.leclerc@alterway.fr> // and Hervé Leclerc <herve.leclerc@alterway.fr>
// Icons by Mark James <http://www.famfamfam.com/lab/icons/silk/> // Icons by Mark James <http://www.famfamfam.com/lab/icons/silk/>
.// Version 2.5 -> 3.2.7 by Dominique Ottello aka Otomatic // Version 2.5 -> 3.2.6 by Dominique Ottello aka Otomatic
// 3.2.5 - Improved layout and css classic   
//       - All PhpMyAdmin versions with warning if not compatible with PHP   
//   
   
$server_dir = "../"; $server_dir = "../";
   
require $server_dir.'scripts/config.inc.php'; require $server_dir.'scripts/config.inc.php';
require $server_dir.'scripts/wampserver.lib.php'; require $server_dir.'scripts/wampserver.lib.php';
   
//path to alias files //path to alias files
$aliasDir = $server_dir.'alias/'; $aliasDir = $server_dir.'alias/';
   
//Works if you have ServerSignature On and ServerTokens Full in httpd.conf //Works if you have ServerSignature On and ServerTokens Full in httpd.conf
$server_software = $_SERVER['SERVER_SOFTWARE']; $server_software = $_SERVER['SERVER_SOFTWARE'];
$error_content = ''; $error_content = '';
   
.$host= gethostname();  
$ip = ($host ? gethostbyname($host) : 'localhost');  
   
// we get the versions of the applications // we get the versions of the applications
$phpVersion = $wampConf['phpVersion']; $phpVersion = $wampConf['phpVersion'];
$apacheVersion = $wampConf['apacheVersion']; $apacheVersion = $wampConf['apacheVersion'];
$doca_version = 'doca'.substr($apacheVersion,0,3); $doca_version = 'doca'.substr($apacheVersion,0,3);
$mysqlVersion = $wampConf['mysqlVersion']; $mysqlVersion = $wampConf['mysqlVersion'];
   
//We get the value of VirtualHostMenu //We get the value of VirtualHostMenu
$VirtualHostMenu = $wampConf['VirtualHostSubMenu']; $VirtualHostMenu = $wampConf['VirtualHostSubMenu'];
   
//we get the value of apachePortUsed //we get the value of apachePortUsed
$port = $wampConf['apachePortUsed']; $port = $wampConf['apachePortUsed'];
$UrlPort = $port !== "80" ? ":".$port : ''; $UrlPort = $port !== "80" ? ":".$port : '';
//We get the value(s) of the listening ports in Apache //We get the value(s) of the listening ports in Apache
$ListenPorts = implode(' - ',listen_ports($c_apacheConfFile)); $ListenPorts = implode(' - ',listen_ports($c_apacheConfFile));
//We get the value of mysqlPortUsed //We get the value of mysqlPortUsed
$Mysqlport = $wampConf['mysqlPortUsed']; $Mysqlport = $wampConf['mysqlPortUsed'];
   
//Directories to ignore in projects //Directories to ignore in projects
$projectsListIgnore = array ('.','..','wampthemes','wamplangues'); $projectsListIgnore = array ('.','..','wampthemes','wamplangues');
   
//Search for available themes //Search for available themes
$styleswitcher = '<select id="themes">'."\n"; $styleswitcher = '<select id="themes">'."\n";
$themes = glob('wampthemes/*', GLOB_ONLYDIR); $themes = glob('wampthemes/*', GLOB_ONLYDIR);
foreach ($themes as $theme) { foreach ($themes as $theme) {
   if(file_exists($theme.'/style.css')) {    if(file_exists($theme.'/style.css')) {
       $theme = str_replace('wampthemes/', '', $theme);        $theme = str_replace('wampthemes/', '', $theme);
       $styleswitcher .= '<option id="'.$theme.'">'.$theme.'</option>'."\n";        $styleswitcher .= '<option id="'.$theme.'">'.$theme.'</option>'."\n";
   }    }
} }
$styleswitcher .= '</select>'."\n"; $styleswitcher .= '</select>'."\n";
   
//Displaying phpinfo //Displaying phpinfo
if(isset($_GET['phpinfo'])) { if(isset($_GET['phpinfo'])) {
   $type_info = intval(trim($_GET['phpinfo']));    $type_info = intval(trim($_GET['phpinfo']));
   if($type_info < -1 || $type_info > 64)    if($type_info < -1 || $type_info > 64)
       $type_info = -1;        $type_info = -1;
   phpinfo($type_info);    phpinfo($type_info);
   exit();    exit();
} }
   
//Displaying xdebug_info(); //Displaying xdebug_info();
$xdebug_info = ''; $xdebug_info = '';
if(function_exists('xdebug_info')) { if(function_exists('xdebug_info')) {
   if(isset($_GET['xdebuginfo'])) {    if(isset($_GET['xdebuginfo'])) {
       xdebug_info();        xdebug_info();
       exit();        exit();
   }    }
   $xdebug_info = '<li><a href="?xdebuginfo">xdebug_info()</a></li>';    $xdebug_info = '<li><a href="?xdebuginfo">xdebug_info()</a></li>';
} }
   
// Language // Language
$langue = $wampConf['language']; $langue = $wampConf['language'];
$i_langues = glob('wamplangues/index_*.php'); $i_langues = glob('wamplangues/index_*.php');
$languages = array(); $languages = array();
foreach($i_langues as $value) { foreach($i_langues as $value) {
 $languages[] = str_replace(array('wamplangues/index_','.php'), '', $value);  $languages[] = str_replace(array('wamplangues/index_','.php'), '', $value);
} }
$langueget = (!empty($_GET['lang']) ? strip_tags(trim($_GET['lang'])) : ''); $langueget = (!empty($_GET['lang']) ? strip_tags(trim($_GET['lang'])) : '');
if(in_array($langueget,$languages)) if(in_array($langueget,$languages))
   $langue = $langueget;    $langue = $langueget;
   
.// Recherche des différentes langues disponibles // Search for available languages
$langueswitcher = '<form method="get" style="display:inline-block;"><select name="lang" id="langues" onchange="this.form.submit();">'."\n"; $langueswitcher = '<form method="get" style="display:inline-block;"><select name="lang" id="langues" onchange="this.form.submit();">'."\n";
$selected = false; $selected = false;
foreach($languages as $i_langue) { foreach($languages as $i_langue) {
 $langueswitcher .= '<option value="'.$i_langue.'"';  $langueswitcher .= '<option value="'.$i_langue.'"';
 if(!$selected && $langue == $i_langue) {  if(!$selected && $langue == $i_langue) {
   $langueswitcher .= ' selected ';    $langueswitcher .= ' selected ';
   $selected = true;    $selected = true;
 }  }
 $langueswitcher .= '>'.$i_langue.'</option>'."\n";  $langueswitcher .= '>'.$i_langue.'</option>'."\n";
} }
$langueswitcher .= '</select></form>'; $langueswitcher .= '</select></form>';
   
include 'wamplangues/index_english.php'; include 'wamplangues/index_english.php';
if(file_exists('wamplangues/index_'.$langue.'.php')) { if(file_exists('wamplangues/index_'.$langue.'.php')) {
   $langue_temp = $langues;    $langue_temp = $langues;
   include 'wamplangues/index_'.$langue.'.php';    include 'wamplangues/index_'.$langue.'.php';
   $langues = array_merge($langue_temp, $langues);    $langues = array_merge($langue_temp, $langues);
} }
   
.//initialisation  // MySQL retrieval if supported 
// Récupération MySQL si supporté   
$nbDBMS = 0; $nbDBMS = 0;
$MySQLdb = ''; $MySQLdb = '';
if(isset($wampConf['SupportMySQL']) && $wampConf['SupportMySQL'] =='on') { if(isset($wampConf['SupportMySQL']) && $wampConf['SupportMySQL'] =='on') {
   $nbDBMS++;    $nbDBMS++;
   $defaultDBMSMySQL = ($wampConf['mysqlPortUsed'] == '3306') ? "&nbsp;-&nbsp;".$langues['defaultDBMS'] : "";    $defaultDBMSMySQL = ($wampConf['mysqlPortUsed'] == '3306') ? "&nbsp;-&nbsp;".$langues['defaultDBMS'] : "";
   $MySQLdb = <<< EOF    $MySQLdb = <<< EOF
<dt>{$langues['versm']}</dt> <dt>{$langues['versm']}</dt>
   <dd>${mysqlVersion}&nbsp;-&nbsp;{$langues['mysqlportUsed']}{$Mysqlport}{$defaultDBMSMySQL}&nbsp;-&nbsp; <a href='http://{$langues['docm']}'>{$langues['documentation-of']} MySQL</a></dd>    <dd>${mysqlVersion}&nbsp;-&nbsp;{$langues['mysqlportUsed']}{$Mysqlport}{$defaultDBMSMySQL}&nbsp;-&nbsp; <a href='http://{$langues['docm']}'>{$langues['documentation-of']} MySQL</a></dd>
EOF; EOF;
} }
   
// MariaDB retrieval if supported // MariaDB retrieval if supported
$MariaDB = ''; $MariaDB = '';
if(isset($wampConf['SupportMariaDB']) && $wampConf['SupportMariaDB'] =='on') { if(isset($wampConf['SupportMariaDB']) && $wampConf['SupportMariaDB'] =='on') {
   $nbDBMS++;    $nbDBMS++;
   $defaultDBMSMaria = ($wampConf['mariaPortUsed'] == '3306') ? "&nbsp;-&nbsp;".$langues['defaultDBMS'] : "";    $defaultDBMSMaria = ($wampConf['mariaPortUsed'] == '3306') ? "&nbsp;-&nbsp;".$langues['defaultDBMS'] : "";
   $MariaDB = <<< EOF    $MariaDB = <<< EOF
<dt>{$langues['versmaria']}</dt> <dt>{$langues['versmaria']}</dt>
 <dd>${c_mariadbVersion}&nbsp;-&nbsp;{$langues['mariaportUsed']}{$wampConf['mariaPortUsed']}{$defaultDBMSMaria}&nbsp;-&nbsp; <a href='http://{$langues['docmaria']}'>{$langues['documentation-of']} MariaDB</a></dd>  <dd>${c_mariadbVersion}&nbsp;-&nbsp;{$langues['mariaportUsed']}{$wampConf['mariaPortUsed']}{$defaultDBMSMaria}&nbsp;-&nbsp; <a href='http://{$langues['docmaria']}'>{$langues['documentation-of']} MariaDB</a></dd>
EOF; EOF;
} }
   
/* Help MySQL - MariaDB popup */  /* Help MySQL - MariaDB popup */ 
$popupLink = ''; $popupLink = '';
if($nbDBMS > 1) { if($nbDBMS > 1) {
   $popupLink = <<< EOF    $popupLink = <<< EOF
- <a class='popup'>MySQL - MariaDB<span>{$langues['HelpMySQLMariaDB']}</span></a> - <a class='popup'>MySQL - MariaDB<span>{$langues['HelpMySQLMariaDB']}</span></a>
EOF; EOF;
} }
//Default DBMS in first position //Default DBMS in first position
if(empty($defaultDBMSMySQL)) if(empty($defaultDBMSMySQL))
   $DBMSTypes = $MariaDB.str_replace('</dd>',$popupLink.'</dd>',$MySQLdb);    $DBMSTypes = $MariaDB.str_replace('</dd>',$popupLink.'</dd>',$MySQLdb);
else else
   $DBMSTypes = $MySQLdb.str_replace('</dd>',$popupLink.'</dd>',$MariaDB);    $DBMSTypes = $MySQLdb.str_replace('</dd>',$popupLink.'</dd>',$MariaDB);
   
// No Database Mysql System // No Database Mysql System
$noDBMS = (empty($MySQLdb) && empty($MariaDB)) ? true : false; $noDBMS = (empty($MySQLdb) && empty($MariaDB)) ? true : false;
   
$aliasContents = ''; $aliasContents = '';
// alias retrieval // alias retrieval
GetPhpMyAdminVersions(); GetPhpMyAdminVersions();
if(is_dir($aliasDir)) { if(is_dir($aliasDir)) {
   $handle=opendir($aliasDir);    $handle=opendir($aliasDir);
   while (false !== ($file = readdir($handle))) {    while (false !== ($file = readdir($handle))) {
     if(is_file($aliasDir.$file) && strstr($file, '.conf')) {      if(is_file($aliasDir.$file) && strstr($file, '.conf')) {
           $href = $file = str_replace('.conf','',$file);            $href = $file = str_replace('.conf','',$file);
       if(stripos($file,'phpmyadmin') !== false || stripos($file,'adminer') !== false) {        if(stripos($file,'phpmyadmin') !== false || stripos($file,'adminer') !== false) {
           if(!$noDBMS) {            if(!$noDBMS) {
                   if(stripos($file,'phpmyadmin') !== false) {                    if(stripos($file,'phpmyadmin') !== false) {
                       foreach($phpMyAdminAlias as $key => $value) {                        foreach($phpMyAdminAlias as $key => $value) {
                           if($phpMyAdminAlias[$key]['alias'] == $file) {                            if($phpMyAdminAlias[$key]['alias'] == $file) {
                               $href = $phpMyAdminAlias[$key]['alias'];                                $href = $phpMyAdminAlias[$key]['alias'];
                               $file = 'PhpMyAdmin '.$phpMyAdminAlias[$key]['version'];                                $file = 'PhpMyAdmin '.$phpMyAdminAlias[$key]['version'];
                               $aliasContents .= '<li><a href="'.$href.'/">'.$file.'</a></li>';                                $aliasContents .= '<li><a href="'.$href.'/">'.$file.'</a></li>';
                               if($phpMyAdminAlias[$key]['compat'] !== true) {                                if($phpMyAdminAlias[$key]['compat'] !== true) {
                                   $aliasContents .= '<li class="phpmynot">'.$phpMyAdminAlias[$key]['notcompat'].'</li>';                                    $aliasContents .= '<li class="phpmynot">'.$phpMyAdminAlias[$key]['notcompat'].'</li>';
                               }                                }
                           }                            }
                       }                        }
                   }                    }
                   else {                    else {
                   $aliasContents .= '<li><a href="'.$href.'/">'.$file.'</a></li>';                    $aliasContents .= '<li><a href="'.$href.'/">'.$file.'</a></li>';
                   }                    }
               }                }
           }            }
           elseif(stripos($file,'phpsysinfo') === false){            elseif(stripos($file,'phpsysinfo') === false){
           $aliasContents .= '<li><a href="'.$href.'/">'.$file.'</a></li>';            $aliasContents .= '<li><a href="'.$href.'/">'.$file.'</a></li>';
       }        }
     }      }
   }    }
   closedir($handle);    closedir($handle);
} }
   
if(empty($aliasContents)) if(empty($aliasContents))
   $aliasContents = "<li class='phpmynot'>".$langues['txtNoAlias']."</li>\n";    $aliasContents = "<li class='phpmynot'>".$langues['txtNoAlias']."</li>\n";
   
$phpsysinfo = file_exists($aliasDir.'phpsysinfo.conf') ? '<li><a href="phpsysinfo">PhpSysInfo</a></li>' : ''; $phpsysinfo = file_exists($aliasDir.'phpsysinfo.conf') ? '<li><a href="phpsysinfo">PhpSysInfo</a></li>' : '';
   
//Retrieving ServerName from httpd-vhosts.conf //Retrieving ServerName from httpd-vhosts.conf
$addVhost = "<li><a href='add_vhost.php?lang=".$langue."'>".$langues['txtAddVhost']."</a></li>"; $addVhost = "<li><a href='add_vhost.php?lang=".$langue."'>".$langues['txtAddVhost']."</a></li>";
if($VirtualHostMenu == "on") { if($VirtualHostMenu == "on") {
   $vhostError = false;    $vhostError = false;
   $vhostErrorCorrected = true;    $vhostErrorCorrected = true;
   $error_message = array();    $error_message = array();
   $allToolsClass = "four-columns";    $allToolsClass = "four-columns";
   $virtualHost = check_virtualhost();    $virtualHost = check_virtualhost();
   $vhostsContents = '';    $vhostsContents = '';
   if($virtualHost['include_vhosts'] === false) {    if($virtualHost['include_vhosts'] === false) {
       $vhostsContents = "<li><i style='color:red;'>Error Include Apache</i></li>";        $vhostsContents = "<li><i style='color:red;'>Error Include Apache</i></li>";
       $vhostError = true;        $vhostError = true;
       $error_message[] = sprintf($langues['txtNoIncVhost'],$wampConf['apacheVersion']);        $error_message[] = sprintf($langues['txtNoIncVhost'],$wampConf['apacheVersion']);
   }    }
   else {    else {
       if($virtualHost['vhosts_exist'] === false) {        if($virtualHost['vhosts_exist'] === false) {
           $vhostsContents = "<li><i style='color:red;'>No vhosts file</i></li>";            $vhostsContents = "<li><i style='color:red;'>No vhosts file</i></li>";
           $vhostError = true;            $vhostError = true;
           $error_message[] = sprintf($langues['txtNoVhostFile'],$virtualHost['vhosts_file']);            $error_message[] = sprintf($langues['txtNoVhostFile'],$virtualHost['vhosts_file']);
       }        }
       else {        else {
               if($virtualHost['nb_Server'] > 0) {                if($virtualHost['nb_Server'] > 0) {
               $port_number = true;                $port_number = true;
               $nb_Server = $virtualHost['nb_Server'];                $nb_Server = $virtualHost['nb_Server'];
               $nb_Virtual = $virtualHost['nb_Virtual'];                $nb_Virtual = $virtualHost['nb_Virtual'];
               $nb_Document = $virtualHost['nb_Document'];                $nb_Document = $virtualHost['nb_Document'];
               $nb_Directory = $virtualHost['nb_Directory'];                $nb_Directory = $virtualHost['nb_Directory'];
               $nb_End_Directory = $virtualHost['nb_End_Directory'];                $nb_End_Directory = $virtualHost['nb_End_Directory'];
   
               foreach($virtualHost['ServerName'] as $key => $value) {                foreach($virtualHost['ServerName'] as $key => $value) {
                   if($virtualHost['ServerNameValid'][$value] === false) {                    if($virtualHost['ServerNameValid'][$value] === false) {
                       $vhostError = true;                        $vhostError = true;
                       $vhostErrorCorrected = false;                        $vhostErrorCorrected = false;
                       $vhostsContents .= '<li>'.$value.' - <i style="color:red;">syntax error</i></li>';                        $vhostsContents .= '<li>'.$value.' - <i style="color:red;">syntax error</i></li>';
                       $error_message[] = sprintf($langues['txtServerName'],"<span style='color:black;'>".$value."</span>",$virtualHost['vhosts_file']);                        $error_message[] = sprintf($langues['txtServerName'],"<span style='color:black;'>".$value."</span>",$virtualHost['vhosts_file']);
                   }                    }
                   elseif($virtualHost['ServerNameValid'][$value] === true) {                    elseif($virtualHost['ServerNameValid'][$value] === true) {
                       $UrlPortVH = ($virtualHost['ServerNamePort'][$value] != '80') ? ':'.$virtualHost['ServerNamePort'][$value] : '';                        $UrlPortVH = ($virtualHost['ServerNamePort'][$value] != '80') ? ':'.$virtualHost['ServerNamePort'][$value] : '';
                       if(!$virtualHost['port_listen'] && $virtualHost['ServerNamePortListen'][$value] !== true || $virtualHost['ServerNamePortApacheVar'][$value] !== true) {                        if(!$virtualHost['port_listen'] && $virtualHost['ServerNamePortListen'][$value] !== true || $virtualHost['ServerNamePortApacheVar'][$value] !== true) {
                           $value_url = ((strpos($value, ':') !== false) ? strstr($value,':',true) : $value);                            $value_url = ((strpos($value, ':') !== false) ? strstr($value,':',true) : $value);
                           $vhostsContents .= '<li>'.$value_url.$UrlPortVH.' - <i style="color:red;">Not a Listen port</i></li>';                            $vhostsContents .= '<li>'.$value_url.$UrlPortVH.' - <i style="color:red;">Not a Listen port</i></li>';
                           if($virtualHost['ServerNamePortListen'][$value] !== true)                            if($virtualHost['ServerNamePortListen'][$value] !== true)
                               $msg_error = ' not an Apache Listen port';                                $msg_error = ' not an Apache Listen port';
                           elseif($virtualHost['ServerNamePortApacheVar'][$value] !== true)                            elseif($virtualHost['ServerNamePortApacheVar'][$value] !== true)
                               $msg_error = ' not an Apache define variable';                                $msg_error = ' not an Apache define variable';
                           if(!$vhostError) {                            if(!$vhostError) {
                               $vhostError = true;                                $vhostError = true;
                               $vhostErrorCorrected = false;                                $vhostErrorCorrected = false;
                               $error_message[] = "Port ".$UrlPortVH." used for the VirtualHost is ".$msg_error;                                $error_message[] = "Port ".$UrlPortVH." used for the VirtualHost is ".$msg_error;
                           }                            }
                       }                        }
                       elseif($virtualHost['ServerNameIp'][$value] !== false) {                        elseif($virtualHost['ServerNameIp'][$value] !== false) {
                           $vh_ip = $virtualHost['ServerNameIp'][$value];                            $vh_ip = $virtualHost['ServerNameIp'][$value];
                           if($virtualHost['ServerNameIpValid'][$value] !== false) {                            if($virtualHost['ServerNameIpValid'][$value] !== false) {
                               $vhostsContents .= '<li><a href="http://'.$vh_ip.$UrlPortVH.'">'.$vh_ip.'</a> <i>('.$value.')</i></li>';                                $vhostsContents .= '<li><a href="http://'.$vh_ip.$UrlPortVH.'">'.$vh_ip.'</a> <i>('.$value.')</i></li>';
                           }                            }
                           else {                            else {
                               $vhostError = true;                                $vhostError = true;
                               $vhostErrorCorrected = false;                                $vhostErrorCorrected = false;
                               $vhostsContents .= '<li>'.$vh_ip.' for '.$value.' - <i style="color:red;">IP not valid</i></li>';                                $vhostsContents .= '<li>'.$vh_ip.' for '.$value.' - <i style="color:red;">IP not valid</i></li>';
                               $error_message[] = sprintf($langues['txtServerNameIp'],"<span style='color:black;'>".$vh_ip."</span>","<span style='color:black;'>".$value."</span>",$virtualHost['vhosts_file']);                                $error_message[] = sprintf($langues['txtServerNameIp'],"<span style='color:black;'>".$vh_ip."</span>","<span style='color:black;'>".$value."</span>",$virtualHost['vhosts_file']);
                           }                            }
                       }                        }
                       elseif($virtualHost['DocRootNotwww'][$value] === false) {                        elseif($virtualHost['DocRootNotwww'][$value] === false) {
                           $vhostError = true;                            $vhostError = true;
                           $vhostErrorCorrected = false;                            $vhostErrorCorrected = false;
                           $vhostsContents .= '<li>'.$value.' - <i style="color:red;">DocumentRoot error</i></li>';                            $vhostsContents .= '<li>'.$value.' - <i style="color:red;">DocumentRoot error</i></li>';
                           $error_message[] = sprintf($langues['txtDocRoot'],"<span style='color:black;'>".$value."</span>","<span style='color:black;'>".$wwwDir."</span>");                            $error_message[] = sprintf($langues['txtDocRoot'],"<span style='color:black;'>".$value."</span>","<span style='color:black;'>".$wwwDir."</span>");
                       }                        }
                       elseif($virtualHost['ServerNameDev'][$value] === true) {                        elseif($virtualHost['ServerNameDev'][$value] === true) {
                           $vhostError = true;                            $vhostError = true;
                           $vhostErrorCorrected = false;                            $vhostErrorCorrected = false;
                           $vhostsContents .= '<li>'.$value.' - <i style="color:red;">TLD error</i></li>';                            $vhostsContents .= '<li>'.$value.' - <i style="color:red;">TLD error</i></li>';
                           $error_message[] = sprintf($langues['txtTLDdev'],"<span style='color:black;'>".$value."</span>","<span style='color:black;'>.dev</span>");                            $error_message[] = sprintf($langues['txtTLDdev'],"<span style='color:black;'>".$value."</span>","<span style='color:black;'>.dev</span>");
                       }                        }
                       elseif($virtualHost['ServerNameIntoHosts'][$value] === false) {                        elseif($virtualHost['ServerNameIntoHosts'][$value] === false) {
                           $vhostError = true;                            $vhostError = true;
                           $vhostErrorCorrected = false;                            $vhostErrorCorrected = false;
                           $vhostsContents .= '<li>'.$value.' - <i style="color:red;">hosts file error</i></li>';                            $vhostsContents .= '<li>'.$value.' - <i style="color:red;">hosts file error</i></li>';
                           $error_message[] = sprintf($langues['txtNoHosts'],"<span style='color:black;'>".$value."</span>");                            $error_message[] = sprintf($langues['txtNoHosts'],"<span style='color:black;'>".$value."</span>");
                       }                        }
                       else {                        else {
                           $value_url = ((strpos($value, ':') !== false) ? strstr($value,':',true) : $value);                            $value_url = ((strpos($value, ':') !== false) ? strstr($value,':',true) : $value);
                           $valueaff = ($virtualHost['ServerNameIDNA'][$value] === true) ? "<p style='margin:-8px 0 -8px 25px;'><small>IDNA-> ".$virtualHost['ServerNameUTF8'][$value]."</small></p>" : '';                            $valueaff = ($virtualHost['ServerNameIDNA'][$value] === true) ? "<p style='margin:-8px 0 -8px 25px;'><small>IDNA-> ".$virtualHost['ServerNameUTF8'][$value]."</small></p>" : '';
                           $vhostsContents .= '<li><a href="http://'.$value_url.$UrlPortVH.'">'.$value.'</a>'.$valueaff.'</li>';                            $vhostsContents .= '<li><a href="http://'.$value_url.$UrlPortVH.'">'.$value.'</a>'.$valueaff.'</li>';
                       }                        }
                   }                    }
                   else {                    else {
                       $vhostError = true;                        $vhostError = true;
                       $error_message[] = sprintf($langues['txtVhostNotClean'],$virtualHost['vhosts_file']);                        $error_message[] = sprintf($langues['txtVhostNotClean'],$virtualHost['vhosts_file']);
                   }                    }
               }                }
               //Check number of <Directory equals </Directory                //Check number of <Directory equals </Directory
               if($nb_End_Directory != $nb_Directory) {                if($nb_End_Directory != $nb_Directory) {
                   $vhostError = true;                    $vhostError = true;
                   $vhostErrorCorrected = false;                    $vhostErrorCorrected = false;
                   $error_message[] = sprintf($langues['txtNbNotEqual'],"&lt;Directory ....&gt;","&lt;/Directory&gt;",$virtualHost['vhosts_file']);                    $error_message[] = sprintf($langues['txtNbNotEqual'],"&lt;Directory ....&gt;","&lt;/Directory&gt;",$virtualHost['vhosts_file']);
               }                }
               //Check number of DocumentRoot equals to number of ServerName                //Check number of DocumentRoot equals to number of ServerName
               if($nb_Document != $nb_Server) {                if($nb_Document != $nb_Server) {
                   $vhostError = true;                    $vhostError = true;
                   $vhostErrorCorrected = false;                    $vhostErrorCorrected = false;
                   $error_message[] = sprintf($langues['txtNbNotEqual'],"DocumentRoot","ServerName",$virtualHost['vhosts_file']);                    $error_message[] = sprintf($langues['txtNbNotEqual'],"DocumentRoot","ServerName",$virtualHost['vhosts_file']);
               }                }
               //Check validity of DocumentRoot                //Check validity of DocumentRoot
               if($virtualHost['document'] === false) {                if($virtualHost['document'] === false) {
                   foreach($virtualHost['documentPath'] as $value) {                    foreach($virtualHost['documentPath'] as $value) {
                       if($virtualHost['documentPathValid'][$value] === false) {                        if($virtualHost['documentPathValid'][$value] === false) {
                           $documentPathError = $value;                            $documentPathError = $value;
                           $vhostError = true;                            $vhostError = true;
                           $vhostErrorCorrected = false;                            $vhostErrorCorrected = false;
                           $error_message[] = sprintf($langues['txtNoPath'],"<span style='color:black;'>".$value."</span>", "DocumentRoot", $virtualHost['vhosts_file']);                            $error_message[] = sprintf($langues['txtNoPath'],"<span style='color:black;'>".$value."</span>", "DocumentRoot", $virtualHost['vhosts_file']);
                           break;                            break;
                       }                        }
                   }                    }
               }                }
               //Check validity of Directory Path                //Check validity of Directory Path
               if($virtualHost['directory'] === false) {                if($virtualHost['directory'] === false) {
                   foreach($virtualHost['directoryPath'] as $value) {                    foreach($virtualHost['directoryPath'] as $value) {
                       if($virtualHost['directoryPathValid'][$value] === false) {                        if($virtualHost['directoryPathValid'][$value] === false) {
                           $documentPathError = $value;                            $documentPathError = $value;
                           $vhostError = true;                            $vhostError = true;
                           $vhostErrorCorrected = false;                            $vhostErrorCorrected = false;
                           $error_message[] = sprintf($langues['txtNoPath'],"<span style='color:black;'>".$value."</span>", "&lt;Directory ...", $virtualHost['vhosts_file']);                            $error_message[] = sprintf($langues['txtNoPath'],"<span style='color:black;'>".$value."</span>", "&lt;Directory ...", $virtualHost['vhosts_file']);
                           break;                            break;
                       }                        }
                   }                    }
               }                }
               //Check number of <VirtualHost equals or > to number of ServerName                //Check number of <VirtualHost equals or > to number of ServerName
               if($nb_Server != $nb_Virtual && $wampConf['NotCheckDuplicate'] == 'off') {                if($nb_Server != $nb_Virtual && $wampConf['NotCheckDuplicate'] == 'off') {
                   $port_number = false;                    $port_number = false;
                   $vhostError = true;                    $vhostError = true;
                   $vhostErrorCorrected = false;                    $vhostErrorCorrected = false;
                   $error_message[] = sprintf($langues['txtNbNotEqual'],"&lt;VirtualHost","ServerName",$virtualHost['vhosts_file']);                    $error_message[] = sprintf($langues['txtNbNotEqual'],"&lt;VirtualHost","ServerName",$virtualHost['vhosts_file']);
               }                }
               //Check number of port definition of <VirtualHost *:xx> equals to number of ServerName                //Check number of port definition of <VirtualHost *:xx> equals to number of ServerName
               if($virtualHost['nb_Virtual_Port'] != $nb_Virtual && $wampConf['NotCheckDuplicate'] == 'off') {                if($virtualHost['nb_Virtual_Port'] != $nb_Virtual && $wampConf['NotCheckDuplicate'] == 'off') {
                   $port_number = false;                    $port_number = false;
                   $vhostError = true;                    $vhostError = true;
                   $vhostErrorCorrected = false;                    $vhostErrorCorrected = false;
                   $error_message[] = sprintf($langues['txtNbNotEqual'],"port definition of &lt;VirtualHost *:xx&gt;","ServerName",$virtualHost['vhosts_file']);                    $error_message[] = sprintf($langues['txtNbNotEqual'],"port definition of &lt;VirtualHost *:xx&gt;","ServerName",$virtualHost['vhosts_file']);
               }                }
               //Check validity of port number                //Check validity of port number
               if($port_number && $virtualHost['port_number'] === false) {                if($port_number && $virtualHost['port_number'] === false) {
                   $port_number = false;                    $port_number = false;
                   $vhostError = true;                    $vhostError = true;
                   $vhostErrorCorrected = false;                    $vhostErrorCorrected = false;
                   $error_message[] = sprintf($langues['txtPortNumber'],"&lt;VirtualHost *:port&gt;",$virtualHost['vhosts_file']);                    $error_message[] = sprintf($langues['txtPortNumber'],"&lt;VirtualHost *:port&gt;",$virtualHost['vhosts_file']);
               }                }
               //Check if duplicate ServerName                //Check if duplicate ServerName
               if($virtualHost['nb_duplicate'] > 0) {                if($virtualHost['nb_duplicate'] > 0) {
                   $DuplicateNames = '';                    $DuplicateNames = '';
                   foreach($virtualHost['duplicate'] as $NameValue)                    foreach($virtualHost['duplicate'] as $NameValue)
                       $DuplicateNames .= " ".$NameValue;                        $DuplicateNames .= " ".$NameValue;
                   $vhostError = true;                    $vhostError = true;
                   $vhostErrorCorrected = false;                    $vhostErrorCorrected = false;
                   $error_message[] = "Duplicate ServerName <span style='color:blue;'>".$DuplicateNames."</span> into ".$virtualHost['vhosts_file'];                    $error_message[] = "Duplicate ServerName <span style='color:blue;'>".$DuplicateNames."</span> into ".$virtualHost['vhosts_file'];
               }                }
               //Check if duplicate Server IP                //Check if duplicate Server IP
               if($virtualHost['nb_duplicateIp'] > 0) {                if($virtualHost['nb_duplicateIp'] > 0) {
                   $DuplicateNames = '';                    $DuplicateNames = '';
                   foreach($virtualHost['duplicateIp'] as $NameValue)                    foreach($virtualHost['duplicateIp'] as $NameValue)
                       $DuplicateNames .= " ".$NameValue;                        $DuplicateNames .= " ".$NameValue;
                   $vhostError = true;                    $vhostError = true;
                   $vhostErrorCorrected = false;                    $vhostErrorCorrected = false;
                   $error_message[] = "Duplicate IP <span style='color:blue;'>".$DuplicateNames."</span> into ".$virtualHost['vhosts_file'];                    $error_message[] = "Duplicate IP <span style='color:blue;'>".$DuplicateNames."</span> into ".$virtualHost['vhosts_file'];
               }                }
           }            }
       }        }
   }    }
   if(empty($vhostsContents)) {    if(empty($vhostsContents)) {
       $vhostsContents = "<li><i style='color:red:'>No VirtualHost</i></li>";        $vhostsContents = "<li><i style='color:red:'>No VirtualHost</i></li>";
       $vhostError = true;        $vhostError = true;
       $error_message[] = sprintf($langues['txtNoVhost'],$wampConf['apacheVersion']);        $error_message[] = sprintf($langues['txtNoVhost'],$wampConf['apacheVersion']);
   }    }
   if(!$c_hostsFile_writable){    if(!$c_hostsFile_writable){
       $vhostError = true;        $vhostError = true;
       $error_message[] = sprintf($langues['txtNotWritable'],$c_hostsFile)."<br>".nl2br($WarningMsg);        $error_message[] = sprintf($langues['txtNotWritable'],$c_hostsFile)."<br>".nl2br($WarningMsg);
   }    }
   if($vhostError) {    if($vhostError) {
       $vhostsContents .= "<li><i style='color:red;'>Error(s)</i> See below</li>";        $vhostsContents .= "<li><i style='color:red;'>Error(s)</i> See below</li>";
       $error_content .= "<p style='color:red;'>";        $error_content .= "<p style='color:red;'>";
       foreach($error_message as $value) {        foreach($error_message as $value) {
           $error_content .= $value."<br />";            $error_content .= $value."<br />";
       }        }
       $error_content .= "</p>\n";        $error_content .= "</p>\n";
       if($vhostErrorCorrected)        if($vhostErrorCorrected)
           $addVhost = "<li><a href='add_vhost.php?lang=".$langue."'>".$langues['txtAddVhost']."</a> <span style='font-size:0.72em;color:red;'>".$langues['txtCorrected']."</span></li>";            $addVhost = "<li><a href='add_vhost.php?lang=".$langue."'>".$langues['txtAddVhost']."</a> <span style='font-size:0.72em;color:red;'>".$langues['txtCorrected']."</span></li>";
   }    }
} }
else { else {
   $allToolsClass = "three-columns";    $allToolsClass = "three-columns";
} }
//End retrieving ServerName from httpd-vhosts.conf //End retrieving ServerName from httpd-vhosts.conf
   
// Project recovery // Project recovery
.// récupération des projets : $projectContents  
$handle=opendir("."); $handle=opendir(".");
.$projectContents = "<i>htttp://$ip/</i><br/>"; $projectContents = '';
while (false !== ($file = readdir($handle))) { while (false !== ($file = readdir($handle))) {
   if(is_dir($file) && !in_array($file,$projectsListIgnore)){    if(is_dir($file) && !in_array($file,$projectsListIgnore)){
.        $projectContents .= ($wampConf['LinksOnProjectsHomePage'] == 'on') ? "<li><a href='http://$ip/".$file."/'>".$file."</a></li>" : '<li>'.$file.'</li>';        $projectContents .= ($wampConf['LinksOnProjectsHomePage'] == 'on') ? "<li><a href='http://localhost/".$file."/'>".$file."</a></li>" : '<li>'.$file.'</li>';
   }    }
} }
closedir($handle); closedir($handle);
if(empty($projectContents)) if(empty($projectContents))
   $projectContents = "<li class='projectsdir'>".$langues['txtNoProjet']."</li>\n";    $projectContents = "<li class='projectsdir'>".$langues['txtNoProjet']."</li>\n";
else { else {
.    if($wampConf['LinksOnProjectsHomePage'] == 'off' && strpos($projectContents,"http://$ip/") !== false) {    if($wampConf['LinksOnProjectsHomePage'] == 'off' && strpos($projectContents,"http://localhost/") !== false) {
       $projectContents .= "<li><i style='color:blue;'>Warning:</i> See below</li>";        $projectContents .= "<li><i style='color:blue;'>Warning:</i> See below</li>";
       if(!isset($error_content))        if(!isset($error_content))
           $error_content = '';            $error_content = '';
       $error_content .= "<p style='color:blue;'>".sprintf($langues['nolocalhost'],$wampConf['apacheVersion'])."</p>";        $error_content .= "<p style='color:blue;'>".sprintf($langues['nolocalhost'],$wampConf['apacheVersion'])."</p>";
   }    }
   else {    else {
       $projectContents .= "<li class='projectsdir'>".sprintf($langues['txtProjects'],$wwwDir)."</li>";        $projectContents .= "<li class='projectsdir'>".sprintf($langues['txtProjects'],$wwwDir)."</li>";
   }    }
} }
   
//initialisation //initialisation
$phpExtContents = ''; $phpExtContents = '';
   
// Retrieving PHP extensions // Retrieving PHP extensions
$loaded_extensions = get_loaded_extensions(); $loaded_extensions = get_loaded_extensions();
// alphabetical order of extensions // alphabetical order of extensions
setlocale(LC_ALL,"{$langues['locale']}"); setlocale(LC_ALL,"{$langues['locale']}");
sort($loaded_extensions,SORT_LOCALE_STRING); sort($loaded_extensions,SORT_LOCALE_STRING);
foreach ($loaded_extensions as $extension) foreach ($loaded_extensions as $extension)
   $phpExtContents .= "<li>${extension}</li>";    $phpExtContents .= "<li>${extension}</li>";
   
//Miscellaneous checks - Which php.ini is loaded? //Miscellaneous checks - Which php.ini is loaded?
$phpini = strtolower(trim(str_replace("\\","/",php_ini_loaded_file()))); $phpini = strtolower(trim(str_replace("\\","/",php_ini_loaded_file())));
$c_phpConfFileOri = strtolower($c_phpVersionDir.'/php'.$wampConf['phpVersion'].'/'.$phpConfFileForApache); $c_phpConfFileOri = strtolower($c_phpVersionDir.'/php'.$wampConf['phpVersion'].'/'.$phpConfFileForApache);
$c_phpCliConf = strtolower($c_phpVersionDir.'/php'.$wampConf['phpVersion'].'/'.$wampConf['phpConfFile']); $c_phpCliConf = strtolower($c_phpVersionDir.'/php'.$wampConf['phpVersion'].'/'.$wampConf['phpConfFile']);
   
if($phpini != strtolower($c_phpConfFile) && $phpini != $c_phpConfFileOri) { if($phpini != strtolower($c_phpConfFile) && $phpini != $c_phpConfFileOri) {
   $error_content .= "<p style='color:red;'>*** ERROR *** The PHP configuration loaded file is: ".$phpini." - should be: ".$c_phpConfFile." or ".$c_phpConfFileOri;    $error_content .= "<p style='color:red;'>*** ERROR *** The PHP configuration loaded file is: ".$phpini." - should be: ".$c_phpConfFile." or ".$c_phpConfFileOri;
   $error_content .= "<br>You must perform: <span style='color:green;'>Right-click icon Wampmanager -> Refresh</span><br>";    $error_content .= "<br>You must perform: <span style='color:green;'>Right-click icon Wampmanager -> Refresh</span><br>";
   if($phpini == $c_phpCliConf || $phpini == $c_phpCliConfFile)    if($phpini == $c_phpCliConf || $phpini == $c_phpCliConfFile)
       $error_content .= " - This file is only for PHP in Command Line.";        $error_content .= " - This file is only for PHP in Command Line.";
   $error_content .= "</p>";    $error_content .= "</p>";
} }
if($filelist = php_ini_scanned_files()) { if($filelist = php_ini_scanned_files()) {
   if(strlen($filelist) > 0) {    if(strlen($filelist) > 0) {
       $error_content .= "<p style='color:red;'>*** ERROR *** There are too many php.ini files</p>";        $error_content .= "<p style='color:red;'>*** ERROR *** There are too many php.ini files</p>";
       $files = explode(',', $filelist);        $files = explode(',', $filelist);
       foreach ($files as $file) {        foreach ($files as $file) {
           $error_content .= "<p style='color:red;'>*** ERROR *** There are other php.ini files: ".trim(str_replace("\\","/",$file))."</p>";            $error_content .= "<p style='color:red;'>*** ERROR *** There are other php.ini files: ".trim(str_replace("\\","/",$file))."</p>";
       }        }
   }    }
} }
   
$pageContents = <<< EOPAGE $pageContents = <<< EOPAGE
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
   <title>{$langues['titreHtml']}</title>    <title>{$langues['titreHtml']}</title>
   <meta charset="UTF-8">    <meta charset="UTF-8">
 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
 <meta name="viewport" content="width=device-width">  <meta name="viewport" content="width=device-width">
   <link id="stylecall" rel="stylesheet" href="wampthemes/classic/style.css" />    <link id="stylecall" rel="stylesheet" href="wampthemes/classic/style.css" />
   <link rel="shortcut icon" href="favicon.ico" type="image/ico" />    <link rel="shortcut icon" href="favicon.ico" type="image/ico" />
</head> </head>
   
<body> <body>
 <div id="head">  <div id="head">
   <div class="innerhead">    <div class="innerhead">
       <h1><abbr title="Windows">W</abbr><abbr title="Apache">a</abbr><abbr title="MySQL/MariaDB">m</abbr><abbr title="PHP">p</abbr><abbr title="server WEB local">server</abbr></h1>        <h1><abbr title="Windows">W</abbr><abbr title="Apache">a</abbr><abbr title="MySQL/MariaDB">m</abbr><abbr title="PHP">p</abbr><abbr title="server WEB local">server</abbr></h1>
          <ul>           <ul>
              <li>Apache 2.4</li><li>-</li><li>MySQL 5 &amp; 8</li><li>-</li><li>MariaDB 10</li><li>-</li><li>PHP 5, 7 &amp; 8</li>               <li>Apache 2.4</li><li>-</li><li>MySQL 5 &amp; 8</li><li>-</li><li>MariaDB 10</li><li>-</li><li>PHP 5, 7 &amp; 8</li>
          </ul>           </ul>
    </div>     </div>
       <ul class="utility">        <ul class="utility">
         <li>Version ${c_wampVersion} - ${c_wampMode}</li>          <li>Version ${c_wampVersion} - ${c_wampMode}</li>
     <li>${langueswitcher}${styleswitcher}</li>      <li>${langueswitcher}${styleswitcher}</li>
     </ul>      </ul>
   </div>    </div>
   
   <div class="config">    <div class="config">
       <div class="innerconfig">        <div class="innerconfig">
       <h2> {$langues['titreConf']} </h2>        <h2> {$langues['titreConf']} </h2>
           <dl class="content">            <dl class="content">
               <dt>{$langues['versa']}</dt>                <dt>{$langues['versa']}</dt>
                   <dd>${apacheVersion}&nbsp;&nbsp;-&nbsp;<a href='http://{$langues[$doca_version]}'>{$langues['documentation-of']} Apache</a></dd>                    <dd>${apacheVersion}&nbsp;&nbsp;-&nbsp;<a href='http://{$langues[$doca_version]}'>{$langues['documentation-of']} Apache</a></dd>
               <dt>{$langues['server']}</dt>                <dt>{$langues['server']}</dt>
                   <dd>${server_software}&nbsp;-&nbsp;{$langues['portUsed']}{$ListenPorts}</dd>                    <dd>${server_software}&nbsp;-&nbsp;{$langues['portUsed']}{$ListenPorts}</dd>
               <dt>{$langues['versp']}</dt>                <dt>{$langues['versp']}</dt>
                   <dd>${phpVersion}&nbsp;&nbsp;-&nbsp;<a href='http://{$langues['docp']}'>{$langues['documentation-of']} PHP</a></dd>                    <dd>${phpVersion}&nbsp;&nbsp;-&nbsp;<a href='http://{$langues['docp']}'>{$langues['documentation-of']} PHP</a></dd>
               <dt>{$langues['phpExt']}</dt>                <dt>{$langues['phpExt']}</dt>
                   <dd class='ddphpext'>                    <dd class='ddphpext'>
                       <ul class='phpext'>                        <ul class='phpext'>
                           ${phpExtContents}                            ${phpExtContents}
                       </ul>                        </ul>
                   </dd>                    </dd>
                       ${DBMSTypes}                        ${DBMSTypes}
           </dl>            </dl>
     </div>      </div>
 </div>  </div>
   
   <div class="divider1">&nbsp;</div>    <div class="divider1">&nbsp;</div>
   
   <div class="alltools ${allToolsClass}">    <div class="alltools ${allToolsClass}">
       <div class="inneralltools">        <div class="inneralltools">
           <div class="column">            <div class="column">
               <h2>{$langues['titrePage']}</h2>                <h2>{$langues['titrePage']}</h2>
               <ul class="tools">                <ul class="tools">
                   <li><a href="?phpinfo=-1">phpinfo()</a></li>                    <li><a href="?phpinfo=-1">phpinfo()</a></li>
                   {$xdebug_info}                    {$xdebug_info}
                   {$phpsysinfo}                    {$phpsysinfo}
                   {$addVhost}                    {$addVhost}
               </ul>                </ul>
           </div>            </div>
                   <div class="column">                    <div class="column">
               <h2>{$langues['txtProjet']}</h2>                <h2>{$langues['txtProjet']}</h2>
               <ul class="projects">                <ul class="projects">
                   ${projectContents}                    ${projectContents}
               </ul>                </ul>
           </div>            </div>
               <div class="column">                <div class="column">
               <h2>{$langues['txtAlias']}</h2>                <h2>{$langues['txtAlias']}</h2>
               <ul class="aliases">                <ul class="aliases">
                   ${aliasContents}                    ${aliasContents}
               </ul>                </ul>
           </div>            </div>
EOPAGE; EOPAGE;
if($VirtualHostMenu == "on") { if($VirtualHostMenu == "on") {
$pageContents .= <<< EOPAGEA $pageContents .= <<< EOPAGEA
           <div class="column">            <div class="column">
               <h2>{$langues['txtVhost']}</h2>                <h2>{$langues['txtVhost']}</h2>
               <ul class="vhost">                <ul class="vhost">
                   ${vhostsContents}                    ${vhostsContents}
               </ul>                </ul>
           </div>            </div>
EOPAGEA; EOPAGEA;
} }
if(!empty($error_content)) { if(!empty($error_content)) {
$pageContents .= <<< EOPAGEB $pageContents .= <<< EOPAGEB
   <div id="error" style="clear:both;"></div>    <div id="error" style="clear:both;"></div>
   ${error_content}    ${error_content}
EOPAGEB; EOPAGEB;
} }
$pageContents .= <<< EOPAGEC $pageContents .= <<< EOPAGEC
       </div>        </div>
   </div>    </div>
   
   <div class="divider2">&nbsp;</div>    <div class="divider2">&nbsp;</div>
   
   <ul id="foot">    <ul id="foot">
       <li><a href="{$langues['forumLink']}">{$langues['forum']}</a></li>        <li><a href="{$langues['forumLink']}">{$langues['forum']}</a></li>
   </ul>    </ul>
   
<script> <script>
var select = document.getElementById("themes"); var select = document.getElementById("themes");
if(select.addEventListener) { if(select.addEventListener) {
   /* Only for modern browser and IE > 9 */     /* Only for modern browser and IE > 9 */ 
   var stylecall = document.getElementById("stylecall");    var stylecall = document.getElementById("stylecall");
   /* looking for stored style name */     /* looking for stored style name */ 
   var wampStyle = localStorage.getItem("wampStyle");    var wampStyle = localStorage.getItem("wampStyle");
   if(wampStyle !== null) {    if(wampStyle !== null) {
       stylecall.setAttribute("href", "wampthemes/" + wampStyle + "/style.css");        stylecall.setAttribute("href", "wampthemes/" + wampStyle + "/style.css");
       selectedOption = document.getElementById(wampStyle);        selectedOption = document.getElementById(wampStyle);
       selectedOption.setAttribute("selected", "selected");        selectedOption.setAttribute("selected", "selected");
   }    }
   else {    else {
       localStorage.setItem("wampStyle","classic");        localStorage.setItem("wampStyle","classic");
       selectedOption = document.getElementById("classic");        selectedOption = document.getElementById("classic");
       selectedOption.setAttribute("selected", "selected");        selectedOption.setAttribute("selected", "selected");
   }    }
   /* Changing style when select change */     /* Changing style when select change */ 
   
   select.addEventListener("change", function(){    select.addEventListener("change", function(){
       var styleName = this.value;        var styleName = this.value;
       stylecall.setAttribute("href", "wampthemes/" + styleName + "/style.css");        stylecall.setAttribute("href", "wampthemes/" + styleName + "/style.css");
       localStorage.setItem("wampStyle", styleName);        localStorage.setItem("wampStyle", styleName);
   })    })
} }
</script> </script>
</body> </body>
</html> </html>
EOPAGEC; EOPAGEC;
   
echo $pageContents; echo $pageContents;
   
?>  ?>