You are here: Re: form - request question « All PHP « IT news, forums, messages
Re: form - request question

Posted by Rik on 05/14/06 16:11

nescio wrote:
> what i want to know is: when i use a session variable as a value in a
> text field, will there then always be
> a phpsessid in de request array when i sent the form?


No.

>>> - if yes: can i then use $amount = sizeof($_REQUEST) - 2; to get
>>> the amount of text fields in the form?
>>
>> Nope, highly unreliable
>
> by text field i also mean text/textarea/listbox etc
>
> if the size of the request array is let's say 10, then the amount of
> text fields (be it text/textarea/listbox etc)
> is 10 minus the submit and the phpsessid, or not?
> is it possible that there are other key's in the array, and if yes,
> which can they be?

You don't control posting to a script, it could contain everything.
Name your desired variables, loop through the $_POST/$_GET array, and check
how many "known" variables is contains. It's tempting to think of shortcuts,
but this isn't the place to cut corners.

Grtz,
--
Rik Wasmus

 

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

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