You are here: Re: newbie question: using $_POST inside of array parameters? « PHP Programming Language « IT news, forums, messages
Re: newbie question: using $_POST inside of array parameters?

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]


Удаленная работа для программистов  •  Как заработать на 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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация