HELP
Special Pricing Account Authorized?
|
$id = $_POST['ID'];
$status = $_POST['status'];
$dbcnx = @mysql_connect('mysql.plainhost.com', 'ecosmar_ecosmart', 'ecoman1');
mysql_select_db('ecosmar_contacts', $dbcnx);
$new = @mysql_query("SELECT ID,name,biz_name,address_1,address_2,city,state,zip,country,phone,email,customer_type,specify,username,password FROM newregister WHERE ID='$id'");
if(!$new){
echo("Error retrieving New Registration from Data Base! " .
"Error:" . mysql_error() . " |
");
}else{
$newreg = mysql_fetch_array($new);
$ID = $newreg[0];
$name = $newreg[1];
$biz_name = addslashes($newreg[2]);
$address_1 = $newreg[3];
$address_2 = $newreg[4];
$city = $newreg[5];
$state = $newreg[6];
$zip = $newreg[7];
$country = $newreg[8];
$phone = $newreg[9];
$email = $newreg[10];
$customer_type = $newreg[11];
$specify = $newreg[12];
$username = $newreg[13];
$password = $newreg[14];
}
$ok = @mysql_query("INSERT INTO special SET name='$name',biz_name='$biz_name',address_1='$address_1',address_2='$address_2',city='$city',state='$state',zip='$zip',country='$country',phone='$phone',email='$email',customer_type='$customer_type',specify='$specify',username='$username',password='$password',status='$status'");
if (!$ok) {
die ("Error entering Registrant into Data Base! ".
'Error:' . mysql_error() . ' |
');
}
$ok2 = @mysql_query("DELETE FROM newregister WHERE ID = '$ID'");
if (!$ok2){
echo("Error deleting from the New Register Data Base! " .
"Error: " . mysql_error() . " |
");
exit;
}
$sql = "OPTIMIZE TABLE newregister";
if(!$sql){
echo("Successful Authorization. But Problem Optimizing DB. Please contact Data Base Administrator. " .
"Error:" . mysql_error() . " |
");
}
$to = "$email" . ",";
$to .= "mross@ecosmartinc.com";
$subject = "Special Pricing at Ecosmartinc.com";
if($status == 'hold'){$message = "Dear $name,\r\nThank you for your interest in Eco-\$mart, Inc. Your registration for Special Pricing is under consideration. We will contact you when our evaluation is complete.\r\nPlease feel free to drop us an email or give us a call with any questions and to let us know how we can be of service.\r\nSincerely,\nMatt Ross, President\nEco-\$mart, Inc.\nwww.ecosmartinc.com\ninfo@ecosmartinc.com\n888-329-2705";
}
else{$message = "Dear $name,\r\nThank you for your interest in Eco-\$mart, Inc. Your login, password and special price level have been approved. Please go to www.ecosmartinc.com/speciallogin.php to log in.\r\nUsername:$username\nPassword: $password\r\nWhen you log into our website, your special price level will be applied to any quotes generated by Quote Request buttons on Eco-\$mart Catalog Pages. Please contact us with any questions and to let us know how we can be of service.\r\nSincerely,\nMatt Ross, President\nEco-\$mart, Inc.\nwww.eco-smart.com\ninfo@eco-smart.com\n888-329-2705";
}
$ok3 = mail($to, $subject, $message, "From: info@ecosmartinc.com");
if ($ok3) {
echo("Registration Authorized. |
");
} else {
echo("Error sending email! " .
"Error: " . mysql_error() . " |
");
}
?>