简体   繁体   中英

get user's email id when user clicks on link

I'm sending a link on gmail account.

analytics.com/get_email_address.php

On this php page,I'm trying to use $_SERVER['HTTP_REFERER'] to get previous URL.But it's giving nothing.Please help me out to get previous URL when user click on the above link (from his gmail inbox).

Actually I'm trying to fetch user's email id.If there is any other idea to get user's email id and domain name,please tell me. Thank You.

GMail is served over HTTPS. To protect the potentially sensitive data that can be in URLs on HTTPS sites, browsers do not send referers when leaving an HTTPS site.

The URL used to access a GMail account does not include any personally identifying information about the user.

That makes it impossible, twice over, to get the information you want from the referer.

Since you know the email address you are sending mail to, you can include it in a query string in the link. Be warned, however, that this can increase your "Probably Spam" score in a lot of filters and if the email is forwarded, the address will not be updated in the forwarded mail.

You are sending a Link, So you can pass a unique ID (Which you have to create earlier on user Registration) with that Link and Retrive it when you going to fetch the user Data.

By that unique ID you can easily get Users EmailID from your database.

You are already sending a link on email id. ie you already have users email id with you.
Simply modify your link to include some digest of users email id in query string part and then in your php script access the query string with $_GET, and then get actual mapped email from the digest.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM