-1
Boas, I need a PHP function, as I cannot, to list files with a certain extension,(html) and put them in a combo box, or Dropbox. Then I need to select a file and press the button, open the corresponding file. Right now, everything works except that when pressing the button appears the link I have to press to open the file. how to do to open soon as you press the boot ?
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>
Young here is the PT.Stackoverflow, please edit your question by writing in Portuguese.
– hugocsl
Translated. Thank you for the reminder,
– Pedro Caldeira