I am working on a project where I am sending daily emails to my clients, These emails contain the details of the pages they want to visit. Now what I am looking to do is that when the user visits these suggested pages, their details gets stored in the database.
For example, I have sent www.example.com/test as an email to many of my clients, Now when one of these client visits the page www.example.com/test, it gets the details of the visitor and the log of this visit gets stored.
No | email | visits | time |
1 |abc@test.com | 1 |20-04-2016 10:00:05 |
2 |xyz@test.com | 3 |20-04-2016 11:00:05 |
You can take this information from $_SERVER var
http://php.net/manual/en/reserved.variables.server.php
$_SERVER['HTTP_REFERER'] - The address of the page (if any) which referred the user agent to the current page
yeah its simple man follow my step
step 1 :while mail sent you just add the your own page link like this
<a href="own_page.php?id=<?php echo any unique user id ?>&original_link=<?php echo facebook.com ?>" >click here</a>
step 2: when user click the link your page navigate so there you do update using user unique id and then redirect him to original link that's all.
It is certainly possible.
There are various methods of doing this.
www.example.com/test?ref=xyz
. When the user accesses the page test then you can have some code to check the ref
GET variable and match it against the values you have in your database which will link it to the user you sent it to. Of course if your users send the links to each other then there may be misleading information. It depends on how accurate you would like the data.However since the web is open to anyone with a web browser, the most accurate method is to make the content accessible only by authentication.