Jump to content

[solved]select dir problam cheers.


redarrow

Recommended Posts

i need to get the select statement to show all the directorys in the select output please help cheers.

know if i put the echo $info within the loop then i get 6 sets of selects so i am trying to output one select with all dir how?



[code]
<?php

$dirpath = "files/";

$dlist = opendir($dirpath);

while ($read = readdir($dlist)) {

$info="<select name='dir'><option value='$read'>$read</option></select>";

}
closedir($dlist);

echo $info;
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/20211-solvedselect-dir-problam-cheers/
Share on other sites

so what was it then the way i set the select up then can you exsplain what was wrong cheers m8.

the code is only for me to understand as a test code to see how it works as meny ask the same question so i was intrested to get it going thank you for the ansaw m8.

ok i get it if you take the <select name=' '> out of the while loop then it only sees it as one select statement but if within the while loop then loops all.

solved cheers.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.