PHP GET data from URL and save it to variable

  • script should get the utm_source, utm_campaign and id from the url of the accessing visitor;
  • save them as variables;
  • list on the page like in the example:

“Hello, you are a special guest because you were recommended by our partner (insert utm_source) so we are giving you a (insert utm_campaign )% discount for your first purchase!”

“Please use this special discount code to get your discount: (insert code generated from first 2 characters of the utm_source + last 2 char of the id + utm_campaign , all should be CAPITALIZED)”

Example visitor link:
https://myurl.com?utm_source=Google& utm_campaign =30&id=11228d

Please help!