Results 1 to 5 of 5

Thread: [Resolved] Pass PHP Array in the URL?

Threaded View

  1. #1

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    [Resolved] Pass PHP Array in the URL?

    I'm calling a page like this: http://localhost/test.php?a[]=a&a[]=b&a[]=c&a[]=d&a[]=e&a[]=f&a[]=g&a[]=h&a[]=i

    And using this code:

    PHP Code:
        <?php
            
    if (isset($_REQUEST['a'])) {
                if (
    is_array($_REQUEST['a'])) {
                    for (
    $i 0$i count($_REQUEST['a']); $i++) {
                        echo 
    $_REQUEST['a'][$i] . '<br />';
                    }
                }
            }
        
    ?>
    It works perfectly, but I'm wondering if there are any drawbacks to it?

    I've never seen anything do it this way before, so it makes me paranoid that there's something wrong with doing it that way.
    Last edited by The Hobo; Jul 13th, 2004 at 12:56 PM.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width