HTML Form Arrays

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
bg
Forum Contributor
Posts: 157
Joined: Fri Sep 12, 2003 11:01 am

HTML Form Arrays

Post by bg »

How do you use form arrays that have been passed via GET?

For example, I have an array on the form arr_property_type[] (defined as such in the input tag) consisting of check boxes.

Does php treat $_GET['arr_property_type'] as an array, or is there something special you need to do? Thanks,

Brian
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Does php treat $_GET['arr_property_type'] as an array
Yep, same as POST.
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post by DuFF »

Code: Select all

<?php
foreach($_GET['checkbox'] as $value) {
    echo "You clicked a checkbox with the value: " . $value"<br />\n";
}
?>
Post Reply