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
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.