Re: Dummy question about gettion "select option" choosen

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

 



Mário Gamito wrote:
Hi,

Thank you all who have helped me in the checkbox's question.

This is an area to which i'm very fresh in PHP.

I now have this code in a form:
---------------------------
<select name="interesse[]">
<option>1</option>
<option>2</option>
<option>3</option>
(etc...)
</select>

if the form containing this element is posted then the following will
so you what exactly is posted:

var_dump( $_POST['interesse'] );

which should show you an array of one or more items, which either
come from many form elements named 'interesse[]' OR from a single
element named 'interesse[]' where that element is multiselect
(in which case the definition should be something like:

	<select name="interesse[]" multiple>

or

	<select name="interesse[]" multiple="multiple">

btw: its not that hard to create a test form with elements
you intend to use and then submit it to a test script that
just outputs what has been posted... so you can see for yourself
what is returned and which vars you need to access in order
to retrieve whatever value you want/need... to see everything
that was posted simply do the following in you [test] submission
handler script:

echo '<pre>' // this just makes it easier to read the var_dump() output.
var_dump( $_POST );

	
--------------------------

My question is, how can i, in the action code, retrieve the option
choosen by the user ?

My most apologies for yet another dummy question, but i google and
google, and i always end up seeing examples fulls of complexity, when i
want is such a simple thing.

Thanking you in advance.

Warm Regards,
Mário Gamito


--
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