$admin_email = "rob@balancedigital.com"; session_start(); ?>
Thank you for subscribing!
"; }else{ $text_block="
You are already subscribed!
"; } }else if (($_POST[op] =="ds") && ($_POST[action] =="unsub")){ if ($_POST[email_addr] ==""){ echo "Errors were encountered. Please fill out the form with a valid email address."; exit; } $vsecc=strtoupper($_POST['vsecc']); if ($vsecc != $_SESSION['secc']) { echo "Invalid verification code."; exit; } include_once("./cgi-bin/connection.php"); $email=escape_data($_POST['email_addr']); $check = "select id, email_addr from $table_name where email_addr = '$email'"; $check_result = @mysql_query($check, $dbc) or die (mysql_error()); $check_num = mysql_num_rows($check_result); if ($check_num < 1 ){ $text_block="Your email is not in the database!
"; }else{ $id = @mysql_result($check_result, 0 , "id"); $sql = "delete from $table_name where id = '$id'"; $result = @mysql_query($sql,$dbc) or die(mysql_error()); $text_block="You are now unsubscribed.
"; } } ?> echo "$text_block"; ?>