\n
\n
\n
\n\n\n"; // Initial screen message echo("

$DOMAIN_T Email Database Unsubscribe

\n"); // set error messages $missing_info_error = "

Sorry. We are unable to unsubscribe you from our list at " . "this time.
" . "Please contact info@$DOMAIN " . "for assistance.

"; $error1 = "

Sorry. You are not currently subscribed to our list
" . "Please contact info@$DOMAIN " . "for assistance.

"; $invite = "

You are welcome to join our mailing list " . "by subscribing on our website " . "

"; // error message if confirm record_num and emails are false if (!$email && !record_num){ echo("$missing_info_error"); echo("$invite\n"); echo($FOOTER); return; } // open table emails $TableName = "contacts"; if ($tn) $TableName = $tn; // match email and record_num $where_clause = "email = '$email' " . "and record_num= '$record_num' " . "and active = 'Y'"; $query = "select * from $TableName " . "where $where_clause"; $results = db_query($query); // if match if (db_num_rows($results) > 0){ if ($confirmed) { // set active to N $query = "update $TableName set active = 'N'" . "where email = '$email'" ; $result = db_query($query); // display thank you echo("

You have been unsubscribed from this list.

\n"); echo ("$invite\n"); } else { echo("

Unsubscribe: $email

\n"); echo("
\n"); echo("\n"); echo(""); echo("\n"); echo("\n"); echo("\n"); echo("
\n"); } } else{ // if no match display error // echo("

$query

\n"); echo("$error1\n"); echo("$invite\n"); echo($FOOTER); return; } // end echo($FOOTER); ?>