select - drop down menu problem :(
Posted: Thu Jul 27, 2006 2:27 am
feyd | Please use
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??
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>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??
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]