Good, I need a function in PHP, since in HTML I can not, to list the files with a certain extension, (html) and put them in a combo box, or dropbox. Then I need you to select a file and press the button, open the file. at this moment, everything works except that pressing the button shows the link that I have to press to open the file. how do I open it as soon as the button is pressed?
Thank you!
<html>
<head>
</head>
<body>
<form action="#" method="post">
<?php
$files = glob('*.html');
echo "<select name='datas'>";
foreach ($files as $file) {
echo "<option>".$file."</option>"; }
echo "</select>";
?>
<input type="submit" name="submit" value="Seleccione a Data" />
</form>
<?php
if(isset($_POST['submit'])){
$selected_val = $_POST['datas'];
echo "<a href=$selected_val>$selected_val</a>";
}
?>
</body>
</html>