Rules: how to create variable with PHP and $_SERVER['HTTP_REFERRER'] I want to parse the query string off the HTTP_REFERRER and make that available as a variable for actions to use.  

I feel like one of these options should let me do that, but I can't be sure...



The concept is simple

&lt;?php 
  $parts = parse_url( $_SERVER['HTTP_REFERRER'] );
  parse_str( $parts['query'], $q );
  // now set $q (or its elements) as the variable
?&gt;
Turns out I just had to look harder and change my expectations a little.


Click Add a Variable
Select text (for my scenario)
In the Value field, you can then use php to echo out a value for a single variable


I was hoping to be able to create a variable with a type of 'object' (or similar) so that I could use the url values like [url:param1] or [url:param2].  

I have not found a way to do that - I just created a different variable for each of the two parameters I needed off the query string.