Re: How would I implement this "remove me" feature in PHP 4?

From: coolsti (coo_at_goontrytospamme.com)
Date: 09/23/04


Date: Thu, 23 Sep 2004 14:37:57 +0200

On Wed, 22 Sep 2004 20:36:55 -0700, D. Alvarado wrote:

> Hello,
> I am running PHP 4. I have a mailing list set up. When I send
> people emails, I would like them to have the option of clicking on
> something, or sending an email such that they would automatically be
> removed from the mailing list. Does anyone have a recommendation as
> to the best way to do this?
>
> Thanks, -

It can be very easy, but takes a little programming. When someone wants to
be removed, they have to identify themselves somehow. If people are
"logged on" to your site, then this is easy, as you have their log on ID,
so they just need to click on some form that sends the message to you that
they are requesting to be removed. Otherwise, you need to respond to their
initial click on a remove button with a form which they will fill out to
identify themselves. Let us say you identify people by their email
address. So you send a form saying they must fill in their email address.

So when you receive this second reply back with an email address, you just
validate it to see if the email address is in your list, and if so, you
remove it. If successful, you send a message back saying so. If not,
because you cannot find them in your list, you tell them that, because
maybe they spelled the email address wrong.

How you implement it in PHP? We are doing this, and have a mysql database
which holds the information for each person in the list, using the email
address as the unique index or identifier. When a person sends their email
with a request to be removed from the list, we do a select statement to
see if there is indeed an entry in the database with that email address.
If successful, we then do a delete statement, and return a message page.
If its not in the database, we send a message saying they could not be
removed because the email could not be found.

Regards,
Steve