Brobinson Posted August 12, 2011 Share Posted August 12, 2011 I'm stumped. I dont know what I did wrong. Can someone show me the errors of my ways? what i'm trying to do is propagate the $subject, $body, and $headers from my database. sincerely; Bryan <?php require_once('connect_to_db.php'); include ("includes/nav/main_nav.html"); $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); // grabs the ID of the specific job passed from the projects_working.php page $pmo_id = $_GET['pmo_id']; // if the submit button on the form is clicked, determine which info will be sent to the database if ($_POST['submit']) { $pmo_id = $_POST['pmo_id']; $staff = $_POST['staff']; // if a specific ID number is present, write the new info to the database if ($pmo_id) { $query = "UPDATE promo_form SET staff='$staff' WHERE pmo_id='$pmo_id'" OR die ('Could not run query!'); mysqli_query ($dbc, $query); } } $to = $staff; $subject = "New job: " .$pmo_promoname; $body = "Promo Type: " .$pmo_promotype.""; $body .= "Start date: " .$pmo_startdate; $body .= "Start time: " .$pmo_starttime; $body .= "Location: " .$pmo_location; $body .= "Details: " .$pmo_wheredetails2; $headers = 'From: [email protected]'; $headers .= 'Cc: ' .$pmo_email; mail($to, $subject, $body, $headers); // yay! echo "<p>Notification has been sent to the designer</p>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/244576-php-mail-and-mysql-help-needed/ Share on other sites More sharing options...
Brobinson Posted August 12, 2011 Author Share Posted August 12, 2011 the double quotes were a mistake, sorry about that it should read as follows. $body = "Promo Type: " .$pmo_promotype; Quote Link to comment https://forums.phpfreaks.com/topic/244576-php-mail-and-mysql-help-needed/#findComment-1256234 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.