406 posts
  • Has referred 100+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+5 more
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
  • Has referred 50+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
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
  • Has been part of the Envato Community for over 6 years
  • Has referred 10+ members
  • Located in Australia
  • Has sold $10,000+ on Envato Market
+2 more
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
  • Has been part of the Envato Community for over 6 years
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
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
  • Has referred 100+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+5 more
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
  • Has referred 100+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+5 more
ryanterry says

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

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by