>> I'm new to php and I have a question.
>>
>> I have this form with the following input:

> It is always better to use associative arrays
> $_POST["input1"] than indexed
> arrays $_POST["input[0]"] for get/post forms.

The only good reason I can think of to use an array like this in a form is
when using multiple select comboboxes. The different selected values are
passed as an array in this case. Otherwise I would give a decent variable
name, not being an array. After all, you can always make an array of the
data afterward.

Don't forget to do a thorough cleanup of the data that are posted. Never
assume, not even when your form only uses comboboxes, that the input is
decent. A hacker may have found the form, noted the names of the variables
that get passed on, and decides to write his own form that gets submitted to
your server.

Make sure the script that handles the form knows *which variables may be
posted from that form and what type of value they contain, then *discards
all data posted for other variables and *cleans all received data acording
to the expected format (numerical, text, etc) and only then does something
with them...

Marc

Reply via email to