You are here: Re: Retrieving the multiple values set by a form « PHP Programming Language « IT news, forums, messages
Re: Retrieving the multiple values set by a form

Posted by anthony on 12/16/55 11:59

I have to wonder why you're using GET at all for form submission. If
you used post, you could just pass in an array:

<form method="POST" action="somesecript.php">
<input type="text" name="values[]"/>
<input type="text" name="values[]"/>
</form>

And in the processing:

foreach ($_POST["values"]):

// do something with each value

endforeach;

~A!


lorento wrote:
> Girish wrote:
> >
> > http://xxxx/get_variables.php?form_variable=value1&form_variable=value2&form_variable=variable
>
> Above request will be read by php like this:
> $_REQUEST["form_variable"] = "value1";
> $_REQUEST["form_variable"] = "value2";
> $_REQUEST["form_variable"] = "value3";
>
> so only the last value will be the result. Because the first will be
> replaced with second value and second value will be replace with the
> last value. I think its better you use different variable name.
>
> http://xxxx/get_variables.php?form_variable1=value1&form_variable2=value2&form_variable3=variable
> You can get all the values of above variables.
>
> ---
> http://www.theukmap.com
> http://www.theaussiemap.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

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