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
'; 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; }
|