此Dropdown突然停止工作。 Dir没有改变,路径应该没问题。我希望一双新鲜的眼睛可以捕捉到我没有看到的东西。提前致谢。
<select name="itinerarypath" type="text" id="itinerarypath">
<option name="itinerarypath" type="text" id="itinerarypath" value="<?php echo $values['itinerarypath'] ?>" selected="selected"><?php echo $values['itinerarypath'] ?></option>
<?php
foreach(glob(dirname(__FILE__) . '../../../uploads/*') as $filename){
$filetypes = array("pdf", );
$filetype = pathinfo($filename, PATHINFO_EXTENSION);
if (in_array(strtolower($filetype), $filetypes)) {
$filename = basename($filename);
echo "<option value='" . $filename . "'>".$filename."</option>";}
}
?>
</select>
答案 0 :(得分:0)
正如EhsanT所说,我只是错过了反斜杠
<select name="itinerarypath" type="text" id="itinerarypath">
<option name="itinerarypath" type="text" id="itinerarypath" value="<?php echo $values['itinerarypath'] ?>" selected="selected"><?php echo $values['itinerarypath'] ?></option>
<?php
foreach(glob(dirname(__FILE__) . '/../../../uploads/*') as $filename){
$filetypes = array("pdf", );
$filetype = pathinfo($filename, PATHINFO_EXTENSION);
if (in_array(strtolower($filetype), $filetypes)) {
$filename = basename($filename);
echo "<option value='" . $filename . "'>".$filename."</option>";}
}
?>
</select>