select - drop down menu problem :(

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
User avatar
SomeOne
Forum Commoner
Posts: 27
Joined: Tue Jul 25, 2006 2:06 am

select - drop down menu problem :(

Post by SomeOne »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


i have a code like this...

Code: Select all

if ( isset ($_GET['dirselect'] )) {
$dir_select = ($_GET['dirselect']);
  echo $dir_select;
  } 
  echo '$dir_select not assigned';
?>
<form method="post" action="<?php $_SERVER['PHP_SELF']  ?>">
<select name="dirselect">
<?php
	   $path = "./slike";
      if ($handle = opendir($path))
   {
       $curDir = substr($path, (strrpos(dirname($path."/."),"/")+1));
       print "Trenutna mapa: ".$curDir."<br>"; 
       while (false !== ($file = readdir($handle)))
       {
           if ($file != "." && $file != "..")
           {
               $fName = $file;
               $file = $path.'/'.$file;
               if(is_dir($file))

               {
                   print "\n<option value=$fName>$fName</option>";
               }
           }
       }
       
	   closedir($handle);
   }  
?>
</select>
  <input type="submit" name="Shrani" value="spremeni" />
</form>
Though...this is not working for me...
im trying to list subfolders of current folder and make drop down menu...and when i select options and press "subbmit" button ..the selected options stored in variable...(so i can chdir later)...
HELP???? any?? 8O


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You've already asked this question.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:3. Do not make multiple, identical posts. This is viewed as spam and will be deleted.
Locked