Dear gentlemen, I would like to ask you a question. Every time I select a directory, a corresponding picture will pop up. How should I do this?
yz666
yz666 2019-08-12 01:45:25
0
2
1213

<select class="span6 disabled" style="padding-left: 0px;" id="val-select2" name="path" style="width: 100%;" data-placeholder="Select page " tabindex="-1" aria-hidden="true" aria-describedby="val-select2-error" aria-invalid="false">

<option value="<?php echo $setting['path']; ?>"><?php echo $setting['path']; ?>(Do not select this)</option>

< ;?php

function traverseDir($dir){

if($dir_handle = @opendir($dir)){

while($filename = readdir($dir_handle )){

if($filename != "." && $filename != ".."){

$subFile = $dir.DIRECTORY_SEPARATOR.$filename; //To convert Source directory and sub-file are connected

if(is_dir($subFile)){ //If the sub-file is a directory

echo '<option value="theme/'.$filename.'" >'.$filename.'</option>';

traverseDir($subFile); //Recursively find the name of the subordinate directory

}

}

}

closedir($dir_handle);

}

}

echo traverseDir(ROOT.'../theme/' );

?>

</select>


yz666
yz666

学习学习

reply all(1)
秋香姐家的小书童

I don’t quite understand what you mean

  • reply Isn't it me who can judge the contents of the folders under the theme folder? Then I think, for example, when option value="theme/abc/index.php", by the way, a picture introduction of abc/index.php will pop up. If it is cba/index.php, a picture introduction of cba will pop up.
    yz666 author 2019-08-14 10:57:58
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template