Email address:

Action:

subscribeunsubscribe

Please retype this code below :

"; }else if (($_POST[op] =="ds") && ($_POST[action] =='sub')){ if ($_POST[email_addr] == "") { echo "Errors were encountered. Please fill out the form completely."; exit; } $vsecc=strtoupper($_POST['vsecc']); if ($vsecc != $_SESSION['secc']) { echo "Invalid verification code. Please go back to the previous page, click refresh to get a new code, then retry."; exit; } include_once("./cgi-bin/connection.php"); $email=escape_data($_POST['email_addr']); $check = "select 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){ $email=escape_data($_POST['email_addr']); $sql = "insert into subscribers values(NULL, '$email', now())"; $result = @mysql_query($sql,$dbc) or die(mysql_error()); $text_block="

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.

"; } } ?>