406 posts
  • Exclusive Author
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Has been a member for 6-7 years
  • Referred between 100 and 199 users
  • Bought between 100 and 499 items
  • United States
ryanterry says

I have a url with variables in it. The variables are used multiple time and I’ve been told that this will automatically put each value for the variable in a list instead of replacing the value each time. I can’t get this to work though.

Example: www.url.com/index.php?variable1=hello&variable1=hello2&variable1=hello3

I’m assuming that in my php using GET that “variable1” would equal “hello,hello2,hello3”. Instead, it equals “hello3”.

Any ideas?

744 posts
  • Sold between 5 000 and 10 000 dollars
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 50 and 99 users
  • Bought between 10 and 49 items
  • United States
fisch79 says

hmmm.. I dont know if that can be done.

But, simple explanation. “variable1” keeps getting replaced by a different value.

Could try this, based on your example:
‘www.url.com/index.php?variable1=’ . value1 . ’,’ . value2 . ’,’ . value3

145 posts
  • Australia
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
bjornredemption says

I have heard that about radio boxes and check boxes not sure if it works if you directly manipulate the URL like that. What do you want the php to do exactly?

436 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 6-7 years
ourben says

I don’t know why somebody told you that they’d get concatenated.

What you are trying to achieve has little to do with PHP really, it depends 99% on what is going on client side. This might happen to be a PHP created page, in which case concatenating would be like:

$variable1 = $_GET['variable1'];
$variable1 .= ",part2";
$variable1 .= ",part3";
// etc
$url = "http://somedomain.tld/page.php?variable1=" . $variable1;

However, if I am right to assume you are using Flash to do whatever it is to these URLs, apply the same technique to those URLs in Flash…

406 posts
  • Exclusive Author
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Has been a member for 6-7 years
  • Referred between 100 and 199 users
  • Bought between 100 and 499 items
  • United States
ryanterry says

The part that is driving me nuts is that I swear this worked a few days ago and now it isn’t. I may be losing my mind. :-)

Thanks anyway, everyone.

406 posts
  • Exclusive Author
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Has been a member for 6-7 years
  • Referred between 100 and 199 users
  • Bought between 100 and 499 items
  • United States
ryanterry says

I spoke with some other coders. They said that .asp concatenates url variables, but php doesn’t read it that way.

by
by
by
by
by
by