Results 1 to 4 of 4

Thread: Pass an array as parameter via URL param

  1. #1
    Join Date
    Oct 2008
    Posts
    86

    Pass an array as parameter via URL param

    There are plenty of pages out there describing how to pass an array to some server-side script. Most of them describe a single parameter, I'll build a table in MySql database containing each individual details for each clothing item, which all item will be displayed in a ordinary repeating thumbnails fashion, where when you click on a certain thumbnail it passes along a url parameter(recordID=#) so that the corrosponding page to filters out by the recordID, which works fine(to my knowledge). The values of the array is then displayed. So the methodology works, but is this the best way to do it ?

  2. #2
    Join Date
    Feb 2006
    Posts
    185

    Re: Pass an array as parameter via URL param

    Split or explode will work fine, but you don`t need a loop to query your database. If you're working in JavaScript there are a couple of reasons why you might want to be able to do this, firstly if the pages of your site are being dynamically generated based on user input in a form then you can make a static link from another part of your site or from another site, for example if you're using a JavaScript search system you can link to the search results for a particular term.

    Code:
    Array
    (
        [parameter] => Array
            (
                [0] => 1
                [1] => 2
                [2] => 5
                [3] => 3
            )
    )

  3. #3
    Join Date
    Jan 2009
    Posts
    163

    Re: Pass an array as parameter via URL param

    Well, it is about dinner time here, so I'll give you a quick one. The could be shorter, but this way it makes hopefully more sense to you. Haven't tested it. If the URL is longer, but this has the advantage, that $_GET{parameter} is an array from the beginning of the script and you don't need to do any splitting:

    print_r($_GET);

  4. #4
    Join Date
    Feb 2006
    Posts
    331

    Re: Pass an array as parameter via URL param

    Are u sure that the IP adress ,default gateway and the DNS server adresses u are entering are right. I don't know how can i run a diagnostic test on my modem.I cant find anything in device manager except my dial up modem which is what am using now. Anyway its WAN Miniport PPPOE..and the modem is ADSL by ZTE coperation.

Similar Threads

  1. Replies: 9
    Last Post: 30-08-2010, 04:57 PM
  2. Pass Array into a function
    By Viensterrr in forum Software Development
    Replies: 3
    Last Post: 24-12-2009, 12:55 PM
  3. function that takes a 2D array as a parameter
    By Umang in forum Software Development
    Replies: 4
    Last Post: 06-05-2009, 11:59 PM
  4. Replies: 4
    Last Post: 25-02-2009, 07:15 PM
  5. Replies: 5
    Last Post: 11-04-2006, 09:43 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,923,778.59579 seconds with 17 queries