There's a cookie, which is set as a user visits one of our affiliate pages, called AffiliateID. I would like to extract the ID from the cookie and put it in an empty form field to be passed on to another PHP doc which creates and sends an email to me. According to my temporary echo though, the cookie is not being read.
It shouldnt be that hard, what you have to do is this.
$affiliate = $_COOKIE['AffiliateID'];
mail("Your Name <firstname.lastname@example.org>", "A user has just visited an affiliate website $affiliate.", "Hello, this email has just been sent to confirm that a user has visited the website of $affiliate.", "From: Affiliate Confirmation <email@example.com>");
And it might not be reading right because you arent setting the cookie correctly.
I've been reading more on cookies and it seems my problem is actually the path There's a complicated Java back-end to the affiliate tracking.