Jump to content

PHP Code Question


Guest

Recommended Posts

I've attached my sample code. This code works just like I need it to. The information chosed or typed in gets sent to my mysql database. On line 54 of this code you will see I have drop down box the users can choose a supervisor. I have supervisor1, supervisor2, and supervisor3. At the end of the code I have a submit button & when it is clicked it send the data chosen/entered into my mysql database perfect.

 

My question is, is there a way for me to enter some type of code in there somewhere so when the user clicks the submit button it will also send an email to supervisor1, supervisor2, or supervisor3 (which ever one is chosen) with all the information that is enetered in the mysql database?

 

I do have an smtp server on my LAN I can use. Thanks for any help you can provide.

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/192428-php-code-question/
Share on other sites

$Name = "$results[first_name] $results[last_name]"; //sender's name
$email = "$results[email]"; //sender's e-mail address
$recipient = "[email protected]"; //recipient(Supervisor's mail)
$mail_body = "$txt";
$subject = "$subj";
$header = "From: ". $Name . " <" . $email . ">\r\n";
mail($recipient, $subject, $mail_body, $header); 

 

mail() may work not correctly if your mail box located at same host. 1 time i had this trouble.

 

Link to comment
https://forums.phpfreaks.com/topic/192428-php-code-question/#findComment-1013944
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.