Page 1 of 1

Hack for listing your projects on the xampp's index page

PostPosted: 04. October 2013 18:15
by vivasharma07
//replace code in xampp/htdocs/xampp/start.php with the below code

<?php
include "langsettings.php";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="author" content="Kai Oswald Seidler, Kay Vogelgesang, Carsten Wiedmann">
<link href="xampp.css" rel="stylesheet" type="text/css">
<title></title>
<script>
function changeProject(ele){
if(ele.value!=''){
window.open('http://localhost:8080/'+ele.value,'_blank');
}
}
</script>
</head>

<body>
&nbsp;<br>
<h1><?=$TEXT['start-head']?>!</h1>
<b><?=$TEXT['start-subhead']?></b><p>


<?=$TEXT['start-text1']?><p>
<?=$TEXT['start-text2']?><p>
<?=$TEXT['start-text3']?><p>
<?=$TEXT['start-text4']?><p>
<?=$TEXT['start-text6']?>
<br><span class="nh" style="color:#000;">Projects</span><br>
<select name="" id="" onchange="changeProject(this);">
<option value="">Select</option>
<?php
$dir = "../";
$d = dir($dir);
$projectContents = "";
while (false !== ($entry = $d->read())) {
$projectContents .= '<option value="'.$entry.'">'.$entry.'</option>';
}
$d->close();
echo $projectContents;
?>
</select>
</body>
</html>