473,659 Members | 3,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Drop-Down Directory...Sub directory..File s

1 New Member
I have a directory structure that is constantly being updated.

Config (Root)
--City (Sub-Dir)
----Address (Sub-Dir)
------File

I'm trying to create a script that will:

1. Scan a directory (will be a root dir) and place the directory names in a drop down box.

2. Choose option (dir) and a 2nd box will appear with subdirectores

3. Once you select an option, a 3rd will be presented

4. This directory will have 1 file that needs to be downloaded

Expand|Select|Wrap|Line Numbers
  1.  
  2. <?php
  3.  
  4. $dir = "D9034-Configs";
  5. if (isset($_GET['Site'])) { $Site = $_GET['Site']; } else { $Site = $_POST['Site']; }
  6. if (isset($_GET['IP_Address'])) { $IP_Address = $_GET['IP_Address']; } else { $IP_Address = $_POST['IP_Address']; }
  7.  
  8. if (!(isset($Site)))
  9. {
  10. ?>
  11. <form id="form1" name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
  12.   <select name="Site" id="Site">
  13. <?php
  14.   $output = shell_exec('ls ./'.$dir.'/');
  15.   $dirs = explode("\n", $output);
  16.   foreach ($dirs as $key => $value)
  17.   {
  18. ?>    <option value="<?php echo $value?>"><?php echo $value?></option><?php
  19.   }
  20. ?>
  21.   </select>
  22. </form>
  23. <?php
  24. }
  25.  
  26. if (isset($Site))
  27. {
  28. ?>
  29. <form id="form1" name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
  30.   <select name="Site" id="Site">
  31. <?php
  32.   $output = shell_exec('ls ./'.$dir.'/');
  33.   $dirs = explode("\n", $output);
  34.   foreach ($dirs as $key => $value)
  35.   {
  36.     if ($value == $Site)
  37.     {
  38. ?>    <option value="<?php echo $value?>" SELECTED><?php echo $value?></option><?php
  39.     }
  40.     else
  41.     {
  42. ?>    <option value="<?php echo $value?>"><?php echo $value?></option><?php
  43.     }
  44.   }
  45. ?>
  46.   </select>
  47.   <select name="IP_Address" id="IP_Address">
  48. <?php
  49.   $output = shell_exec('ls ./'.$dir.'/'.$Site.'/');
  50.   $dirs = explode("\n", $output);
  51.   foreach ($dirs as $key => $value)
  52.   {
  53. ?>    <option value="<?php echo $value?>"><?php echo $value?></option><?php
  54.   }
  55. ?>
  56.   </select>
  57. </form>
  58. <?php
  59. }
  60.  
  61. ?>
Apr 29 '10 #1
0 1247

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4557
by: riehe | last post by:
Dear all I want to drop a node from a nodegroup. Can someone confirm if its enough to redistribute a node group with a partition map which doesn't include the node to be dropped? I can't see any other way to drop node 3 from my setup of 5 nodes than to make a partmap file, DNODE_tmap, formatted so 1 2 4
1
5789
by: Ian Dobson | last post by:
Hi, I need to drop a schema from a database but it has 400 tables in it. Is there an easy way to do it other than drop table schema1.table1 drop table schema1.table2 etc.. to 400 and then drop schema schema1? thanks
10
26096
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not null references another, FK_LASTLYOID bigint not null references lastly, unique (FK_OTHEROID,FK_ANOTHEROID))
8
20832
by: WindAndWaves | last post by:
Hi everyone, Has anyone got any experience with drop and drag in Access? I would like to make a calendar style form where my users can drop and drag appointments.... I am using Access 2003 and I have access to .net and the like, but I would really like to keep it simple.
1
3726
by: Torre Quinn | last post by:
Does anyone have any good sites or resources dealing with adding drag and drop functionality to a set of controls on a form? I'd like to try to get several examples of varied applications of drag and drop being used on different types of controls. My current task is this. I have a treeview control and a data grid control. The data grid has two fields, 'value' and 'name'. I want to be able to drag nodes from the tree view and drop them...
6
3545
by: jojobar | last post by:
Hello, I look at the asp.net 2.0 web parts tutorial on the asp.net web site. I tried to run it under firefox browser but it did not run. If I want to use this feature in a commercial product where the user can run on firefox/mozilla, what would be a good approach. 1. Should I overwrite the javascript code drag-and-drop to make it more browser independent. If I want to go this route, can anybody provide me a
3
10586
by: VB Programmer | last post by:
In VB.NET 2005 (winform) any sample code to drag & drop items between 2 listboxes? Thanks!
1
4707
by: Darren | last post by:
I'm trying to create a file using drag and drop. I want to be able to select a listview item drag it to the shell and create a file. Each icon in the listview represents a blob in a database. When I drop onto the shell I want a file created with a specified name containing the data from the database. I've looked at the FileDrop format but it look to have only the filename and not the data. TIA
15
10806
by: uwcssa | last post by:
I try to drop a table as: I got: During SQL processing it returned: SQL0478N The object type "TABLE" cannot be dropped because there is an object "sch.SQL070515104729271", of type "FUNCTION", which depends on it. SQLSTATE=42893 Then I tried to do
5
13768
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with drag&drop on the same page (which was not possible). Now i´ve a new concept of the script, more object oriented. I´ve also commented the whole code so you guys can easier understand it engine. What exactly we need when trying to make a column drag &...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8531
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.