Reply to Re: Passing values from drop down menu

Your name:

Reply:


Posted by Jim Michaels on 02/17/06 10:15

<barbarowa@yahoo.com> wrote in message
news:imoeu110k4s4mopdc8kk0jrm4g5tlacr34@4ax.com...
>I think I need to clarify what my objective is. Despite the code that
> I posted which my attempt to test what is actually getting passed to
> the program from the drop down menu selection, what I REALLY want is
> to know HOW to pass the variable the correct way and then how to use
> it in a MySQL INSERT statement. I tried the code you provided and
> this is what is shown: $_POST: Array ( )
>
> I know an array is what I'm up against, what I don't know is how to
> deal with it. Does this help clear up what I am looking for?
>
>
>
> On Mon, 06 Feb 2006 10:09:43 +0100, Ivαn Sαnchez Ortega
> <i.punto.sanchez--@rroba--mirame.punto.net> wrote:
>
>>-----BEGIN PGP SIGNED MESSAGE-----
>>Hash: SHA1
>>
>>barbarowa@yahoo.com wrote:
>>
>>>>And why exactly are you mixing $_POST and $HTTP_POST_VARS?
>>>
>>> Just hoping to see what variable values are being passed.

maybe I can save you some time. If you used name="id", $_POST['id'] will
contain your selected value or nothing at all. you can try using isempty()
on it and see if that works.

if your select element were a multiple-select, then you should specify
select's name as id[] which signals to PHP to return an array of values.
then you would
foreach ($_POST['id'] as $val) {
do something with $val
}


>>
>>Then use something like:
>>
>><?php
>>
>>if (isset($_POST))
>>{
>> echo '$_POST: '; print_r($_POST); exit;
>>}
>>else if (isset($HTTP_POST_VARS))
>>{
>> echo '$HTTP_POST_VARS: '; print_r($HTTP_POST_VARS); exit;
>>}
>>
>>?>
>>
>>Think about:
>>- - What if $_POST gets a value but $HTTP_POST_VARS does not? (and the
>>other
>>way round)
>>- - What if $_POST['testform'] gets a value of 0, oran empty string, that
>>will
>>evaluate as false?
>

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация