Quantcast
Channel: PHP Infinite » disable paste
Viewing all articles
Browse latest Browse all 2

Track News Letter Email Record: Read or Not? – Part 2 (without image tag)

$
0
0

Before few days i had write how to track your email or News letter is opened or not and how many time its open, but there is many limitation with that code, some email provider like GOOGLE or YAHOO already Open email with disable mode and user can not enable that images due to low bandwidth and many more, and we set Path for tracking in <img src=”tracking.php”>.

Due Image is not open we can actully count how many time our mail was open so i had develope new code for that if any server dont give permission to image though we count how many user read our news letter or email..
That code is Given Below..

The first thing I did was adding <iframe></iframe> on the footer of the newsletter, whose source was set something like this http://www.phpinfinite.com/newsletter/email-tracker.php?identitycode=NEWSLETTER_ID$SENDEMAILID. Here NEWSLETTER_ID= Your News Letter Id which is Send to any User and SENDEMAILID = email id of the person to which email is send. and i sex width n heigth of <iframe> is 1px * 1px  so no one can see that, actually. Now, when viewing the newsletter on the mail or say when the client reads the newsletter email. The email-tracker.php page is requested with identitycode as the GET parameter. And when you get the request from the mail to your server’s page, you can do anything you want. What I did was setting the mail_read column of the database field as 1. And echoed the source of the image file on the last line.

The Code Which is writen in Newsletter is something like that

1
echo "<iframe width='0px' height='0px' src='".SITE_URL."email-tracker.php?identitycode=".$nletter_id."$".$user->user_email_address."' ></iframe>";

The code below is for the email-tracker.php.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$get=explode("_",$_GET['identitycode']);
$nletterid=$get['0'];
$user_email=$get['1'];$newsletter = 'SELECT * FROM tbl_nletter WHERE nletter_id=$nletterid';
$resource = mysql_query($newsletter);
$newsletterDetail= mysql_fetch_object();$letterData->nletter_id = $nletter_id;
// For Simple Newsletter Open Counting Use This code
$letterData->nletter_open_count = $newsletterDetail->nletter_open_count + 1;
if ($newsletterDetail->open_id_list != '')
$letterData->open_email = $newsletterDetail->open_email.', '.$user_email;
else
$letterData->open_email = $user_email;
// Ende Here //
// For Uniq Visit Count Follow this code$visitEmailList = implode(',',$letterData->open_email);
if ($newsletterDetail->open_email != '')
if (!in_array($user_email,$visitEmailList)){
$letterData->nletter_open_count = $newsletterDetail->nletter_open_count + 1;
$letterData->open_email = $newsletterDetail->open_email.', '.$user_email;
}else{
$letterData->nletter_open_count = $newsletterDetail->nletter_open_count;
$letterData->open_email = $newsletterDetail->open_email
}
}else{
$letterData->nletter_open_count = $newsletterDetail->nletter_open_count;
$letterData->open_email = $newsletterDetail->open_email
}
// Ende Here //
$query="UPDATE tbl_nletter SET nletter_open_count = '".$letterData->nletter_open_count."', open_id_list = '".$letterData->open_id_list."' WHERE nletter_id = ".$letterData->nletter_id;
mysql_query($query);

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images