[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Populate and assign a variable to a selection in a drop down (listbox).

Posted on 2004-04-16
2
Medium Priority
?
191 Views
Last Modified: 2008-03-17
Simple question of creating a list of 4 items (apple, orange, grape,  kiwi) and once the user selects which one, set a variable $fruit to it.  Please help by a coding example.
Thank you,

Russ
0
Comment
Question by:RUSS_EMI
[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
2 Comments
 
LVL 12

Accepted Solution

by:
venkateshwarr earned 200 total points
ID: 10847171
Something like this?

<?php
if(isset($_REQUEST['fruits']))
{
      $fruit = $_REQUEST['fruits'];
      print "fruit = $fruit";
}



?>

<form name='fruitselection' method='get'>
<select name='fruits' onchange="document.forms['fruitselection'].submit();">
<option value='apple'> apple
<option value='orange'> orange
<option value='grape'> grape
<option value='kiwi'> kiwi
</select>
<input type="submit">
</form>
0
 

Author Comment

by:RUSS_EMI
ID: 10861384
Something exactly like that.  Please let me try it out in a few days (I'm traveling now) and I'll be glad to award the points if it is works as I think it will.
Thank you,
Russ
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

656 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