Hi all,

I want to create an 'Unsubscribe' link in the e-mails I'm sending out. If the person receiving the e-mail no longer wants to receive e-mails from me, they click the 'Unsubscribe' link in the e-mail which will be something like this:

http://www.mysite.com/unsub.php?email=person@hotmail.com

So upon click this link they will be taken to a page that says, do you wish to stop receiving these e-mails - Yes / No?

When the user clicks 'Yes', I need to save the e-mail address from the link in a text file.

Could anyone tell me how to do this using php?

Thanks,

Laura

    if the user clicks on "Yes" ( assuming that you're doing this confirmation script with Javascript )... and his/her email address is still in the url, you can do something like :

    <?php
    
    $email = $_GET["email"];
    $conn = fopen("emails.txt","a") or exit("Error In Opening The File!!");
    fwrite($conn,$email."\n");
    fclose($conn)
    
    ?>
    
      4 days later

      thanks daredevil what code would i use to take the e-mail address from one page to the next using php?

        Write a Reply...