The e-mail address can not be blank:


"; $breturn=0; }else{ $qname = "SELECT * FROM consumers WHERE email_addr='" . trim($email_addr) . "'"; $result = mysql_query($qname); $consumercount = mysql_affected_rows(); $qname = "SELECT * FROM patients WHERE email_addr='" . trim($email_addr) . "'"; $result = mysql_query($qname); $patientcount = mysql_affected_rows(); if ($consumercount==0 and $patientcount==0){ echo "

This e-mail address does not exist in our system:


"; if($breturn){ $breturn=0; } } mysql_close(); } if ($breturn) { }else{ echo "
"; echo "

"; echo " E-mail:
"; echo "
"; echo "
"; echo ""; echo " "; echo "
"; echo " "; } return $breturn; } ?> CHIROWEB | Unsubscribe Page

To Your Health Newsletter Unsubscribe

1 or $patientcount>1 or ($consumercount>0 and $patientcount>0)){ #More than one record was found. Force the user to select which #records to delete. echo "Our records indicate that there is more than one subscriber "; echo "with an e-mail address of " . $email_addr . ". Please select "; echo "the records that you wish to have unsubscribed from the To Your "; echo "Health newsletter.
"; echo "
"; if ($consumercount>0){ $i=0; $qname = "SELECT rec_number, first_name, last_name FROM consumers WHERE email_addr='" . trim($email_addr) . "'"; $result = mysql_query($qname); echo "Consumer Subscribers:"; echo ""; echo ""; while ($myrow = mysql_fetch_array($result)) { #Toggle row colors. if ($i%2==0){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; $i++; } echo "
First NameLast NameUnsubscribe
" . $myrow[first_name] . "" . $myrow[last_name] . ""; echo "
"; } if ($patientcount>0){ $i=0; $qname = "SELECT patients.rec_number, patients.first_name as patientsfirst_name, patients.last_name as patientslast_name, chiropractors.first_name as chiropractorsfirst_name, chiropractors.last_name as chiropractorslast_name, chiropractors.suffix, chiropractors.degree FROM patients, chiropractors WHERE patients.email_addr='" . trim($email_addr) . "' and patients.chiropractor_id = chiropractors.rec_id"; $result = mysql_query($qname); echo "
"; echo "Subscribers Who Were Added By A Chiropractor's Office:"; echo ""; echo ""; while ($myrow = mysql_fetch_array($result)) { #Toggle row colors. if ($i%2==0){ echo ""; }else{ echo ""; } echo ""; echo ""; echo ""; echo ""; $i++; } echo "
First NameLast NameOffice OfUnsubscribe
" . $myrow[patientsfirst_name] . "" . $myrow[patientslast_name] . ""; echo $myrow[chiropractorsfirst_name] . " " . $myrow[chiropractorslast_name]; if ($myrow[suffix]<>""){ echo ", " . $myrow[suffix]; } if ($myrow[degree]<>""){ echo ", " . $myrow[degree]; } echo ""; echo "
"; } echo ""; echo "
"; }else{ #No validations fired and the subscriber only existed with one row #in one table, try processing query. $qname = "DELETE FROM consumers WHERE email_addr = '" .$email_addr . "'"; $result = mysql_query($qname); if (mysql_affected_rows()>0){ $deletedrows=mysql_affected_rows(); } $qname = "DELETE FROM patients WHERE email_addr = '" .$email_addr . "'"; $result = mysql_query($qname); if (mysql_affected_rows()>0){ $deletedrows=mysql_affected_rows(); } if ($deletedrows>0){ echo "You have successfully unsubscribed from the To Your Health newsletter."; } } mysql_close(); } } elseif($multiplerecordsubmit){ mysql_connect($hostname); mysql_select_db($dbname); if (count($consumerdeletefields)>0){ #Build the sql statement. $qname = "DELETE FROM consumers WHERE "; for ($i=0;$i<=count($consumerdeletefields);$i++){ if($consumerdeletefields[$i]<>""){ $qname = $qname . "rec_number=" . $consumerdeletefields[$i] . " or "; } } #strip off the last 'or' $qname = substr($qname, 0, strlen($qname) - 3); $result = mysql_query($qname); } if (count($patientdeletefields)>0){ #Build the sql statement. $qname = "DELETE FROM patients WHERE "; for ($i=0;$i<=count($patientdeletefields);$i++){ if($patientdeletefields[$i]<>""){ $qname = $qname . "rec_number=" . $patientdeletefields[$i] . " or "; } } #strip off the last 'or' $qname = substr($qname, 0, strlen($qname) - 3); $result = mysql_query($qname); } echo "You have successfully unsubscribed the selected subscibers from the To Your Health newsletter."; mysql_close(); } else{ ?>

Please enter your e-mail address below to unsubscribe from the To Your Health e-mail newsletter.


E-mail: