[email protected] Posted November 25, 2009 Share Posted November 25, 2009 I am mailing emails, have a unsubscribe link at the bottom on email. How do I delete those folks who click unsubscribe automatically without letting them take any further steps? Link to comment https://forums.phpfreaks.com/topic/182873-delete-unsubscribe-email-addresses/ Share on other sites More sharing options...
Goldeneye Posted November 25, 2009 Share Posted November 25, 2009 Well perhaps do this: <?php // LINK IN THE E-MAIL: <a href="http://foo.bar/unsubscribe.php?subscription=c98946080b795a6c00e4ec2ab3e18fbe //$_GET['subscription'] is an md5-hash of the recipient's email (the recipient that wants to cancel his/her subscription mysql_query("DELETE FROM `mailinglist_table` WHERE `email_hash`='$_GET['subscription']'"); //For this to work, you have to add another column to your mailing-list table //that'll hold the md5-hash (or whatever hash method you choose) of the //recipients' email. ?> Keep in mind that: 1) this is a very preliminary way and you will want to sanitize $_GET variables 2) you don't have use a hash in $_GET['subscription'], you could just simply make $_GET['subscription'] hold the email, but it's a little less of a hassle to do it with hashes. Link to comment https://forums.phpfreaks.com/topic/182873-delete-unsubscribe-email-addresses/#findComment-965269 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.