Mailing list (php/mysql)

Out of context: Reply #1

  • Started
  • Last post
  • 13 Responses
  • acescence0

    your unsubscribe page is missing code to get the values of email and key from the query string. your sql statement is using $email and $email_key, but they are undefined. need to grab values of $_GET['email'] and $_GET['email_key'] first.

    as for uniqueness, you can put a unique index on the email field and an insert will fail if it already exists, but you need to read the mysql_errno to see if inserts succeed if you use this method. the other, slower, method is to do a select first with the email address before it's inserted and see if you get anything back.

View thread