Forum Moderators: coopster
What i mean is > if i want to send a php code in an email such
that whenever the user opens the email he sees the CURRENT DATE
AND TIME.
Or When i post a newsletter, i should get to know the email id
if not then atleast the ip addresses and the number of people
till now who have opened the mail. That means whenever someone
opens an email, the counter should be incremented and displayed
on the email itself or on my server
I want to send php function/code in the email which executes
as it does on my server and not just display the code as text part of the mail
If I have $value=6++;
then if i write echo $value;
It should print 6 on the email for the first time and then increment
and show 7, 8... whenever that mail is opened next..
Well, there are several ways to do the counter functionality. All of them will work only of the email message is HTML formated.
1. Add an image tracker, such as:
<img src="http://www.example.com/tracker.php?email_id=NUMBER" />
Everytime this email message is opened, the tracker.php script at your server will be executed. You may play with this and add extra functionality, for example - to prevent couting of opening the same message from the same recipient more than once.
2. Add an iframe at your code. The iframe source can be loaded again from your server. I am not quite sure if this will working! To display the today date, you can allways add some JavaScript code to your HTML formated message.
Why do you need that id=number part what's it's use?
ok...
I used the following code for email.php.
and when i wrote [url]http://www.example.com/track/email.php?userid=111[/url]
I got the image but no entry in the database? What could be the reason?
<?php
$con = mysql_connect("localhost","user","pass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}mysql_select_db("sqldb", $con);
$userid = $_GET['userid'];
$sql="INSERT INTO quote (contributed_by)
VALUES
('$_GET[userid]')";
mysql_close($con);
?>
<img src="http://www.example.com/gallery/mj_1.jpg">
also is there any way i can increment the userid on it's own rather than sending userid=1 to 1st email and userid=2 to second email if i have around 100 emails; i just want an entry in the data base how all the id's that have viewed?
[edited by: dreamcatcher at 10:13 am (utc) on Aug. 21, 2007]
[edit reason] Use example.com, thanks. [/edit]