我正在使用codeigniter框架。我在电子新闻稿或电子邮件中使用图像跟踪技术来跟踪IP,Refferer URL,电子邮件ID等...我能够跟踪IP,主机IP,Refferer URL但不能跟踪电子邮件地址!< / p>
帮我解决问题。我在下面提到了示例代码。
<img src="<?php echo $this -> config -> item('my_url'); ?>/images/logo.gif?id=<?php echo $rec['track_id'];?>&email=email" width="1" height="1" border="0" />
logo.gif - &gt; index.php文件
@ $db = new mysqli('localhost', 'username', 'password', 'database_name');
if (mysqli_connect_errno()) {
}
if (!empty($_SERVER['REMOTE_ADDR'])) {
$ip = $_SERVER['REMOTE_ADDR'];
$host = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$referrer = $_SERVER['HTTP_REFERER'];
$date = date("Y-m-d");
$time = date("H:i:s");
$track_id = $_GET['id'];
$email = $_GET['email'];
$sql = "INSERT INTO tbl_email_opens (email_opens_id,track_id,email,ip_address,host,referrer) VALUES (null,'$track_id','$email','$ip','$host','$referrer')";
$db->query($sql);
}
header( 'Content-type: image/gif' );
echo chr(71).chr(73).chr(70).chr(56).chr(57).chr(97).
chr(1).chr(0).chr(1).chr(0).chr(128).chr(0).
chr(0).chr(0).chr(0).chr(0).chr(0).chr(0).chr(0).
chr(33).chr(249).chr(4).chr(1).chr(0).chr(0).
chr(0).chr(0).chr(44).chr(0).chr(0).chr(0).chr(0).
chr(1).chr(0).chr(1).chr(0).chr(0).chr(2).chr(2).
chr(68).chr(1).chr(0).chr(59);
答案 0 :(得分:0)
也许你只需要改变这个
&email=email
这样的事情
&email=<?=$rec['email'];?>