Jump to content


quickform - passing data from hierselect

  • Please log in to reply
1 reply to this topic

#1 idig

  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 18 April 2006 - 09:18 AM


appreciate any help.

i have a main array and a 2ndary array to select from. once i have selected for example uk from the main array and london from the 2ndary array, i submit and have a resultant array called for eg 'location' now this array when echo'd gives numbers and not the strings i.e uk and london. what do i need to do to get the strings out?


#2 ToonMariner

  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 18 April 2006 - 11:26 AM

I am assuming you have something like...

$arr = array('London', 'Paris');


<select name="sel">
<option value="0">London</option>
<option value="1">Paris</option>

now there are two ways of doing this...

either change the html to this

<option value="London">London</option>
<option value="Paris">Paris</option>

or (and probably more useful!)

in the script accepting the data have your array(s) once more

$arr = array('London', 'Paris');

and then user $arr[$_POST['sel']]
follow me on twitter @PHPsycho

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users