Re: Reading data from SELECT in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, March 22, 2006 6:00 am, Lorca wrote:
> Hello friends,
> I've create a form containing a SELECT under JavaScript, where the
> user
> decide all list's elements.
>
> My problem is how can I get all list's elements on PHP. Using $-POST[]
> I
> only get the selected option.
>
> With my most sincere thanks.

HTTP simply does not anything other than the selected element.

If you need the other elements, and you don't already know them,
they'd have to be sent as another variable in the FORM itself.

If THAT is impossible, because you are trying to "catch" the values
from somebody else's form or something, you could MAYBE use
$_SERVER['HTTP_REFERER'] and file_get_contents() on that and then you
could attempt to parse the HTML, perhaps with HTMLTidy, and, assuming
the browser bothered to send HTTP_REFERER in the first place, you
could maybe mostly sometimes get the values from that...

But if this is a normal situation on your own server, maybe you just
need to restructure things so that your options list is in an include
file that both the form display script and the form processing script
can include.

Or, maybe, the list of potential inputs should be in your database so
that you can easily modify it -- That's true for many sites built by
beginners.

Just some ideas for you to consider.

Bottom line, HTTP ain't gonna send it to you, so it's up to you to get
it somehow.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux