notify_email($Record, $salesRepID);
$stmt = mysqli_stmt_init($link);
//Create the statement
mysqli_stmt_prepare($stmt, "UPDATE purl.schreur SET
FName = ?,
LName = ?,
email = ?,
phone = ?,
record = ?,
subscribed = ?,
date = ?,
IPAddress = ?,
Business = ?,
Address1 = ?,
City = ?,
State = ?,
Zip = ?,
Coffee = ?,
Meeting = ?,
time = ?")
or die("prepare error " . mysqli_error($link));
mysqli_stmt_bind_param($stmt, 'ssssssssssssssss',
$_POST['txtFName'],
$_POST['txtLName'],
$_POST['txtEmail'],
$_POST['txtPhone'],
$_POST['record'],
$_POST['subscribed'],
$date,
$_SERVER['REMOTE_ADDR'],
$_POST['txtBusiness'],
$_POST['txtAddress1'],
$_POST['txtCity'],
$_POST['txtState'],
$_POST['txtZip'],
$_POST['rdoCoffee'],
$_POST['rdoTime'],
$_POST['areaPlans'])
or die( "bind error " . mysqli_error($link));
//Add the record
mysqli_stmt_execute($stmt) or die( "execute error " .
mysqli_error($link));
?>
notify_email.php file:
<?PHP
function notify_email($Record, $salesRepID) {
require("defaults.php");
require("func.sendemail.php");
require("dbmysqliconnect.php");
$salesRep = array(1 => "tim@xxxxxxxxxxxxxxxxxxx, jpruim@xxxxxxxxxxxxxxxxxxx
", 2 => "richardc@xxxxxxxxxxxxxxxxxxx, jpruim@xxxxxxxxxxxxxxxxxxx",
3 =>"jpruim@xxxxxxxxxxxxxxxxxxx", 4=>"japruim@xxxxxxxxxx");
echo "1";
$link1 = dbmysqliconnect($server, $username, $password,
$database, $link);
echo "2";
$sql = "SELECT * FROM schreur WHERE record='{$Record}'";
$row[] = mysqli_query($link1, $sql) or die("Could not
perform query: ".mysqli_errno($link1));
echo "3";
$result = $row[0];
echo "4";
// $dataSet = array();
// while ($row = mysqli_fetch_assoc($result)) {
//echo "<br>while<BR>";
// $dataSet[] = $row;
// }
$from= "No-Reply@xxxxxxxxxxxxxxxxxxx";
echo "5";
$returnPath = "no-reply@xxxxxxxxxxxxxxxxxxx";
$replyTo = "no-reply@xxxxxxxxxxxxxxxxxxx";
echo $Record;
echo "6";
// echo "<br>Just before while in notify_email.php<br>";
// echo "<br>directly above while<br>";
// echo "<BR>dataset print: ";
// print_r($dataSet);
// echo "<BR>";
// echo "<br>directly above foreach<br>";
//foreach ( $dataSet AS $row ) {
echo "6";
while ($row = mysqli_fetch_assoc($result))
{ echo "inside while";
//Build the e-mail headers
$ID = $row['salesRep'];
$to = $salesRep[$ID];
$headers = "From: ".$from."\n";
$headers .= "Return-Path: ".$returnPath."\n";
$headers .= "Reply-To: ".$replyTo."\n";
$subject = "{$row['FName']} wants coffee!";
$message = "First Name: {$row['FName']} \n";
$message .= "Last Name: {$row['LName']}\n";
$message .= "Company " . $row['Business'] . "\n";
$message .= "Email:" .$row['email'] . "\n";
$message .= "Phone: " .$row['phone'] . "\n";
$message .= "Address: " . $row['Address1'] . "\n";
$message .= "City: " . $row['City'] . "\n";
$message .= "State: " .$row['State'] . "\n";
$message .= "Zip: ". $row['Zip'] . "\n";
$message .= "Coffee of choice: ".$row['Coffee'] . "\n\n";
$message .= "When a good time would be: \n".
$row['Meeting'] . "\n\n";
$message .= "Current plans: \n\n";
$message .= $row['plans'] . "\n\n";
send_email($to, $subject, $message, $headers);
}
echo "7";
echo <<<PRE
<pre>
Headers: $headers
To: $to
Subject: $subject
Message:
$message
</pre>
PRE;
echo "8";
echo "Just after end of while in notify_email.php";
// header("Location: index.php");
echo "9";
} //Function closed
echo "10";
?>
yes all of the echo's in there are for testing purposes to see
where it's choking.
Ever since I started using mod_rewrite, I seem to have lost my
error reporting from php so if someone knows a trick on how to fix
that I would appreciate it :)
On my page when I load it, all I see is the "10" I echo at the end
of the notify_email function.
I think I'm having another dense moment and it will be something
simple but I have looked over the code for the past day with no
break throughs.... So ANY help is greatly appreciated, and comes
with a beverage of choice if you can make it to where I am! :)