Jump to content

Recommended Posts

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>";		
?>

Link to comment
https://forums.phpfreaks.com/topic/244576-php-mail-and-mysql-help-needed/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.