Arrays through forms

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Xelmepa
Forum Commoner
Posts: 41
Joined: Sat Aug 24, 2002 3:02 pm
Location: Athens, Greece
Contact:

Arrays through forms

Post by Xelmepa »

Hey guys,
I had made a script that used form results. I had named the form objects like form[smth] . And I had let my script use these variables like form[smth]. However I remembered that I should do it like form["smth"], so I added quotes throughout the PHP script.

I didn't add any quotations to the form though.
The question is, is $form[smth] == $form["smth"] ?

Or do I need to change the form object names too?

Thanks.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You should leave the HTML form object names as (IIRC it doesn't work otherwise):

Code: Select all

<input type="text" name="form&#1111;smth]" />
and as you have already done quote the element name within the PHP script.

Mac
Post Reply