Solved

Parsing <Select> Tag in PHP from Method Post

Posted on 2003-11-13
1
277 Views
Last Modified: 2013-12-13
I have a drop down list object on one of my web pages - when I Post to my .php file, how do I move through the list to find the selected item? I'm trying to sequence through all the <Select Tag items so I can write them to a table - the selected item I will actually skip because this task is to delete the selected item from the drop down list.

Thanks for any help...
0
Comment
Question by:rfresh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 6

Accepted Solution

by:
DoppyNL earned 125 total points
ID: 9745795
the browser will only sent back a single value to the server; the value wich was selected. all other values will not be sent back to the server.
So you don't have to walk through those values.

simply use this variable:

print($_POST['name_of_select_box']);

to print out the value returned.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question