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 = "
E-mail address:


Action:
sub
unsub



"; } 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\" \n"; if ($check_num == 0) { // if $check_num is 0, then no match was found, // and the user should be subscribed //define validate email function function validate_email($str){ $str = strtolower($str); if(ereg("^([^[:space:]]+)@(.+)\.(ad|ae|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|fi|fj|fk|fm|fo|fr|fx|ga|gb|gov|gd|ge|gf|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nato|nc|ne|net|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw|biz|info|name)$",$str)){ return 1; } else { return 0; } } if(validate_email($email)){ $sql = "insert into subscribers values(\"$email\", \"$add_date\")"; @mysql_query($sql) or die ("Couldn't insert email."); mail("$email", "Phone-Bill-Busters News", "Thanks for subscribing to The Phone-Bill-Busters Free Newsletter! You'll receive important news about telephone service and the telecommunications industry. You may unsubscribe at anytime at http://phone-bill-busters.com/free_newsletter.php3", $headers); $text_block = "

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\" \n"; if ($check_num == 0) { // if $check_num is 0, then no match was found, // and the user cannot be unsubscribed $text_block = "

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!

"; } } ?> Phone Bill Busters Free Newsletter

 

 

   Absolute lowest long distance rates from many carriers without gimmicks.
independent agent for 47 carriers since 1993

       

      Sign Up Here for
      Free Newsletter

      Questions?
      Call Toll Free
      1-800-600-9174

 


call tollfree
1-800-600-9174

 

 

      Important News About Telephone Service
      and the
      Telecommunications Industry

       

      Each week or two we'll send you free updates regarding changes in available rates, fees, and news about the telecommunications industry.

       

       

      Questions? Call 1-800-600-9174
      or mail to Phone Bill Busters
      "Phone Bill Busters" - Nashville, TN