i am looking for a way to automatize my php script, it should search for php files in a folder called SUBPAGES
and include the php files with the Help of a Dropdown
like my example but without recoding it everytime i add a new file.
It should find the files stored in the SUBPAGES
folder by itself and include the selected file automatized.
Can any one please help me in solving it.
<html>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
<div align="center">
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%">
<tr>
<td align="center">
<table border="0" cellspacing="0" cellpadding="0" width="" height="">
<tr>
<td width="300" height="50" bgcolor="#F2F2F2">
<p align="center">
<form name="form">
<p align="center">
<select name="link" SIZE="1" onChange="window.location.href = document.form.link.options[document.form.link.selectedIndex].value;">
<option value="#" style="display:none">Choose</option>
<option value="index.php?id=page1"> Seite1 </option>
<option value="index.php?id=page2"> Seite2 </option>
</select></p>
</form>
</td>
</tr>
<tr>
<td height="20" bgcolor="#999999"> </td>
</tr>
<tr>
<td height="350">
<?php
error_reporting(0);
switch($_GET['id']) {
default:
include('Subpages/page1.php');
break; case "page2":
include('Subpages/page2.php');
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>