I'm trying to create a conversion tag but got problems with IE, hope you can help me.
I got a web site con domain_A.com where I save some cookies on that server.
Then I give a Conversion tag to domain_B.com to paste it in their website, so I can tell that if it was in domain_A.com and then went to domain_B.com
Here is my code:
domain_A.com/index.php
- Code: Select all
<?php
setcookie("flag_id", "0001", time()+60*60*24*365*5);
?>
<html>
<body>
Hello 0001!
</body>
</html>
domain_B.com/index.html
- Code: Select all
<html>
<body>
<img src="https://domain_A.com/conversion.php" width="1" height="1" />
</body>
</html>
domain_A.com/conversion.php
- Code: Select all
<?php
if(isset($_COOKIE['flag_id'])){
$current = file_get_contents('data.txt');
$current .= $_COOKIE['flag_id']."\n";
file_put_contents('data.txt', $current);
}
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false );
header("Content-type: image/gif");
$width = 1;
$height = 1;
$im = ImageCreateTrueColor($width, $height);
$color = ImageColorAllocate($im, 255, 255, 255);
ImageFillToBorder($im, 0, 0, $color, $color);
ImageGIF($im);
ImageDestroy($im);
?>
This is a sample test code, the real stuff is more complicated.
The big problem is that conversion.php can't read the cookies.
Works when I open conversion.php directly, use same domain, or use Firefox...
What could be missing!
Thanks

