|
Posted by Alvaro G. Vicario on 08/29/06 21:54
*** kurrent@gmail.com escribió/wrote (29 Aug 2006 14:24:02 -0700):
> <select name=b size=1>
> <option value=1>number1</option>
> <option value=2>number2</option>
> <option value=0>number3</option>
> </select>
>>From my understanding, I see that $_POST[b] would successfully retrive
> the value of the $b variable. So i've tried many variants on the syntax
> but no luck (e.g. "$a[$_POST[b]]) etc...
I'm unsure of what you're trying to accomplish, but you must learn the
syntax of the different types of identifiers:
$foo -> variable
foo() -> function or class
'foo' -> string
"foo" -> string with variables
foo -> constant
So $_POST[b] won't make any sense unless you previously define a constant
called b:
define('b', 'whatever');
I suppose you just forgot the quotes.
Your sample form creates the following array:
$_POST['b']='1';
$_POST['Submit']='Enviar consulta';
You can see it yourself with var_dump($_POST).
--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
Navigation:
[Reply to this message]
|