Hi,
Coding isn't my strong point as you can probably guess from this question!
I am revamping a site and have decided to use MODX to make future maintenance easier. The problem I have been stuck on all day is regarding the capture of a variable from the url.
The user lands on our page with or without an affiliate tracking paramater appended to the url: -
eg. www.mydomain.co.uk/?int=123
This variable then needs to be stored in a session so that if the user moves around the site the tracking code stays with them and if required added to a link that sends them to our quote engine: -
eg
http://quote.mydomain.co.uk/index.php?int=123
I have this working on our existing site by simply using the following script: -
<?
session_start();
// store session data
$_SESSION['int']=$int;
if ($int == '')
{
$int='0000';
}
?>
And then to redirect the user: -
header('Location:
http://quote.mydomain.co.uk/index.php?int='.$int);
For some reason I can't get it to store the variable within modx. I have read that you don't need to use session_start in modx and have tried other avenues but keep going round in circles!
I would appreciate any help!!
Thanks