The files that are being searched use a pretty good naming system - $program$day$month$year - so I made a form with select elements that correspond to each part of the file name.
Code: Select all
<?php
<!--this is an example of the form values that are sent-->
<select name="dia">
<option value="defaulta">- dia -</option>
<option value="01">1</option>
<option value="02">2</option>
<option value="03">3</option>
<option value="04">4</option>... </select>
// here's the php that the GET[] is sent to
if ($_GET) {
$busqueda = "$programa$dia$mes$ano";
$filename = "$busqueda.mp3";
if (file_exists($filename)) {
print("<a href='$busqueda'>$archivo_nombre</a>");
} else {
print("No encuentra ningun archivo con los criterios dados. Por favor trata otra vez estando menos especifico.");
}
}
?>The second question I have is, if there is more than one match, would I need to put them in an array or is there a function that does that like preg(). I think preg() does something like that but I'm not sure if it finds and takes every result until it hits the regex's designated end characters, placing each in the array.
I'm still pretty new to php so please forgive my ignorance.
Thanks, Holly
?>