0

I have this link with parameter:

http://example.com/article?id=571&id=550&id=276

I wish to get all the id values, form an Array and output to a field, I have tried several ways but none worked, anyone can help ? Thanks

  if (isset($_GET['id'])){

      // create an array to store all ids from the parameter

      // Output each values in the array to $string variable

      $form['submitted']['my_field']['#value'] = $string;  // output all ids via this field.

  }; //endif ;

I wish it will output like this on the field: "571, 550, 276"

Adamtan
  • 253
  • 1
  • 2
  • 15
  • this is not good. you need to use unique keys from the get, and the you can use the `$_GET` or pass it with one parameter with a separator. In yor case, `$_GET['id']` value will be always the last ids value from the url. – vaso123 Oct 22 '14 at 12:31

1 Answers1

0

all of your arguments will be ignored, they must be unique in your URL
Try With this approach http://example.com/article?id=571, 550, 276

if(isset($_GET['id'])){
print $_GET['id'];
}
Halayem Anis
  • 7,654
  • 2
  • 25
  • 45