salman_ahad@yahoo.com 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? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.