473,394 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

readdir & option value

more or less that is my problem:

i'm making HTML <select><option> statement:

if ($dir = @opendir("/the/directory)) {
while($file = readdir($dir)) {

echo '<option value="'.$file.'">'.$file;
}
}
the number of options depends of number of files in directory.

When user chooses one of this files(he chooses an option) i want to know
what option he choosen.

how can i do this?
Jul 17 '05 #1
2 2229
Give the select control a name e.g. <select name="file">. Then the
selected file will be in $_REQUEST['file'] when the form is submitted.

-Sauli Karhu

Piotr Wolski wrote:
more or less that is my problem:

i'm making HTML <select><option> statement:

if ($dir = @opendir("/the/directory)) {
while($file = readdir($dir)) {

echo '<option value="'.$file.'">'.$file;
}
}
the number of options depends of number of files in directory.

When user chooses one of this files(he chooses an option) i want to know
what option he choosen.

how can i do this?


Jul 17 '05 #2
Sauli Karhu wrote:
Give the select control a name e.g. <select name="file">. Then the
selected file will be in $_REQUEST['file'] when the form is submitted.

-Sauli Karhu

Piotr Wolski wrote:
more or less that is my problem:

i'm making HTML <select><option> statement:

if ($dir = @opendir("/the/directory)) {
while($file = readdir($dir)) {

echo '<option value="'.$file.'">'.$file;
}
}
the number of options depends of number of files in directory.

When user chooses one of this files(he chooses an option) i want to
know what option he choosen.

how can i do this?


$_POST['file'] exactly
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: ???????J | last post by:
Javascript may inquire the push down menu value, can I inquire the description? The following example, the variable($answer) can be get the menu1's value. For example, if I select first data,...
1
by: Mike Albrecht | last post by:
Hi folks, Scenario: A form on a web page that passes values to a dll. We want the user to be able to choose among several locations. The value of the variable that gets passed is a 3-letter code...
6
by: Olly | last post by:
I need a script that is not server side at all. I need a user to be able to select a month from a drop down box, and then the year from another. But to run I need them to be able to click a...
29
by: amos | last post by:
Hi I'm experiencing a real nasty thing about dotnet. I've made a big application in dotnet and I would like to use ILAYERS for netscape 4. You CAN NOT USE Layers and Form buttons in...
7
by: DC Gringo | last post by:
I am having a bear of a time with setting a URL query string as a text value in a dropdownlist and Server.URLEncode does not seem to do its job. theFullLink = theLinkPrefix &...
0
by: Daniel Kaplan | last post by:
Anyone have experience using Google AutoFill? My state is highlighted as yellow, so I know Google sees it as an auto fill field, but it won't change the state. Works on other site I go to test,...
4
by: Greg | last post by:
I'm guessing the problem I'm having has something to do with Master Pages or DetailsView because the exact same code works fine on a page without a Master Page and DetailsView controls. The...
0
by: Slickuser | last post by:
From my PHP page: Grab all data from the database. Go through a loop to generate the HTML. Client side: From the Color drop menu list, if a user change the value. It will grab that value &...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.