0


I'm trying to use several GET parameters in a URL.

For example logout-user and clear-cart - is it possible to do something like:

/?clear-cart&&logout-user

What would be the correct way to do it? I'm using WordPress.

nickb
  • 59,313
  • 13
  • 108
  • 143
Ganga
  • 787
  • 1
  • 9
  • 27

1 Answers1

2

If you don't want values for them, you just need one ampersand:

/?clear-cart&logout-user

If you want values, they get equals signs:

/?clear-cart=1&logout-user=true

Don't forget (if you are outputting these URLs) to pass their values through urlencode() so they don't break your URLs.

nickb
  • 59,313
  • 13
  • 108
  • 143
  • Thank you :) one moment after i post i got to same conclusion and figure it out. Your answer is correct. – Ganga Dec 18 '15 at 18:57