Help me with echo the selected option

iam making a small php script that uses scandir() function and then put the resulted dirs in tag
but i don’t know how to echo the user selection
Note : the array of dir names will be changed from computer to another so the values of dirs aren’t fixed …please help me ? :frowning:

My guess, you are not giving the dropdown list a name to get it’s post data.

Here is my code
[php]

Path : <?php $dir = $path; $files = scandir($dir); echo ""; foreach($files as $dir){ echo " $dir "; } echo ""; ?> <?php $path=$_post['dir']; if(isset($_POST['print'])) { echo "$path"; } ?> [/php]

Okay, it’s the other side of the coin. Your items don’t have values to give.

[php]$dir[/php]

oh i got it …Thank you it’s working now :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service