addin newsletter subscribers to db

i wanted to make a script to add my emails to the db. here is the one i used
everytime i submit it i get this error
Access denied for user ‘apache’@‘localhost’ (using password: NO)
i realy dont get this as i havnt mentioned apache once and my password is password…
this was uploaded to server after testing it on xampp

<?php if (isset ($_POST['email'])){ $email = $_POST['email']; $email = stripslashes($email); $email = strip_tags($email); DB INFO HERE $emailCHecker = mysql_real_escape_string($email); $emailCHecker = eregi_replace("`", "", $emailCHecker); // Database duplicate e-mail check setup for use below in the error handling if else conditionals $sql_email_check = mysql_query("SELECT email FROM newsletter WHERE email='$emailCHecker'"); $email_check = mysql_num_rows($sql_email_check); // Error handling for missing data if ((!$email)) { $errorMsg = 'ERROR: You did not submit the following required information:

'; if(!$email){ $errorMsg .= ' * Email Address
'; } if(!$email2){ $errorMsg .= ' * Confirm Email Address
'; } } else { // Error handling is ended, process the data and add member to database //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $email = mysql_real_escape_string($email); $email = eregi_replace("`", "", $email); $sql = mysql_query("INSERT INTO newsletter (email, sign_up_date) VALUES('$email', now())") or die (mysql_error()); $id = mysql_insert_id(); $to = "$email"; $subject = "Welcome to our newsletter "; //Begin HTML Email Message $message = "Hello, Thank you for signing up to our newsletter. If you would ever like to leave please email us. Also, if you would like info about having your websites info in our newsletter, please email us. [email protected]"; //end of message $headers = "From: $from\r\n"; $headers .= "Content-type: text\r\n"; mail($to, $subject, $message, $headers); ; } // Close else after duplication checks } else { // if the form is not posted with variables, place default empty variables so no warnings or errors show $errorMsg = ""; $email = ""; } ?> .brightRed {color: #F00; } .center { text-align: center; }
Please enter your email bellow to recieve our montly newsletter!
" size="25" maxlength="100" />
Sponsor our Newsletter | Privacy Policy | Terms of Service