Unable to connect to the " . "database server at this time.
" ); exit(); } // Select the subscribers database if (! mysql_select_db ("phonebil_subscribers") ) { echo( "Unable to locate the subscribers " . "database at this time.
" ); exit(); } // get a date stamp $add_date = date("Y-m-d"); if ($op != "ds") { //they need to subscribe or unsubscribe $text_block = " "; } else if (($op == "ds") && ($action == "sub")) { // check they're not already subscribed, // then subscribe them or return message $check = "select email_addr from subscribers where email_addr = \"$email\""; $check_result = mysql_query($check) or die("Can't execute check e-mail address."); $check_num = mysql_num_rows($check_result); $headers = "From: \"Phone-Bill-Busters\"Thanks for signing up!
"; } else { $text_block = "Your e-mail address appears to be invalid. Please go back and try again or contact us and we'll see if we can validate your address."; } } else { // if $check_num is not 0, then the user is // already subscribed, and you should let // them know it. $text_block = "You're already subscribed!
"; } } else if (($op == "ds") && ($action == "unsub")) { // check they're already subscribed, // then unsubscribe them or return message $check = "select email_addr from subscribers where email_addr = \"$email\""; $check_result = mysql_query($check) or die("Can't execute check e-mail address."); $check_num = mysql_num_rows($check_result); $headers = "From: \"Phone-Bill-Busters\"Couldn't find your e-mail on the list!
You haven't been unsubscribed, because the e-mail you entered is not in the database."; } else { // if $check_num is not 0, then the user is // on the list, so can be unsubscribed. $sql = "delete from subscribers where email_addr = \"$email\""; @mysql_query($sql) or die ("Couldn't delete email."); mail("$email", "Phone-Bill-Busters News", "Sorry to see you go. You may re-subscribe at anytime at http://phone-bill-busters.com/free_newsletter.php3", $headers); $text_block = "
You're unsubscribed!
"; } } ?>
|
|
||||||
|
Sign
Up Here for
|
|
||||
|
|
Important
News About Telephone Service
|
|||||
|
|
Questions?
Call 1-800-600-9174
|
|