Forum Moderators: coopster
$id = $_POST['status'];
$ok = @mysql_query($sql);
if (!$ok) {
exit('Database error storing file: ' . mysql_error());
} elseif ($ok) {
$to = '';
if ($id == 2 ¦¦ $id == 10) $to = 'example@gmail.com';
else $to = 'me@example.com';
$q = "select status.status_name FROM status where status.status_name=" . $id;
if ($q) $message = 'status_name';
$subject = "current email test";
mail($to, $subject, $message);
echo('File uploaded successfully!<br />example has been notified of your upload and you will recieve an estimate soon<br /><a href="http://www.example.com/sta_fileshare/sta_rma_upload.php">Back to STA File Uploader</a>');
}
}
I guess I really just don't see where to pull the name and how to relate it to it's id. It seems like it should be simple but I just don't see it.
[edited by: jatar_k at 9:33 pm (utc) on Oct. 31, 2007]
[edit reason] examplified [/edit]
$id = $_POST['status'];
$ok = @mysql_query($sql);
if (!$ok) {
exit('Database error storing file: ' . mysql_error());
} elseif ($ok) {
$to = '';
$message = '';
if ($id == 2 ¦¦ $id == 10) $to = 'example@gmail.com';
else $to = 'me@example.com';
$q = "select status_name FROM status where status_name=" . $id;
$query = mysql_query($q);
if ($row = mysql_fetch_array($query)) {
$message .= $row['status_name'];
}
$subject = "current email test";
mail($to, $subject, $message);
echo('File uploaded successfully!<br />example has been notified of your upload and you will recieve an estimate soon<br /><a href="http://www.example.com/sta_fileshare/sta_rma_upload.php">Back to STA File Uploader</a>');
}
}
that should work, you can then append anything to message by using
$message .= 'next value here';