![]() |
|||
Signing up is easy - simply enter your name and E-mail below. } /* end Condition one */ else { /* Condition two - there was a successful sign up */ //DATABASE STUFF // load connection require "../includes/connect.php"; $link = mysql_connect($dbHost, $dbUser, $dbPass); @mysql_select_db("$dbName") or die("Unable to select database"); //$hostname = "localhost"; //$username = "piaa"; //$password = "PFLskjr334"; //$dbName = "piaa"; $adminEmail = "adcook@adcook.com"; $FromName = "Your Signups Database on piaa.com"; $fromEmail = "adcook@adcook.com"; $frName = ucfirst($fName); $lsName = ucfirst($lName); $toEmail = strtolower($toEmail); $message = "Welcome! Thank you, $frName for joining our email list. As a member, you will receive updates and messages pertaining to changes and additions to the PIAA web site as well as occasional things we think you might be interested in. Have a teriffic day! PIAA Corp. "; $userstable = "elist"; /* make connection to database */ MYSQL_CONNECT($hostname,$username,$password) OR DIE("Unable to connect to database"); @mysql_select_db("$dbName") or die("Unable to select database"); $result = mysql_query("SELECT * FROM $userstable where toEmail='$toEmail'"); $count = mysql_num_rows($result); if(!$count) { if (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $toEmail)) { /* Insert information into table */ $query = "INSERT INTO $userstable VALUES('$frName','$lsName','$toEmail','')"; $result = MYSQL_QUERY($query); $num_results = mysql_query("SELECT * FROM $userstable"); $number = mysql_num_rows($num_results); /* Close the database connection */ MYSQL_CLOSE(); /* then print out the confirmation: */ ?> Thank you for visiting us. You've been added to our email list. /*end Condition two */ } else { /* Condition three - an invalid email address */ ?> } /* end Condition three */ } else { /* if there is a duplicate, print out the confirmation anyway: */ ?> Thank you for visiting us. You've been added to our email list. } } ?> CORPORATION | CUSTOMER SERVICE | STAY INFORMED | WHAT'S NEW | DEALER SEARCH | FAQ'S | GLOSSARY | WHY BUY PIAA | CARE & MAINTENANCE | PROTECT YOUR INVESTMENT | PIAA WARRANTY PRODUCTS
|
|||