Jump to content

Delete unsubscribe email addresses


salman_ahad@yahoo.com

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.