spillage Posted October 20, 2008 Share Posted October 20, 2008 Trying to create a form that will be submitted and then and depending on $_POST[fType] will determine the html code shown on the next page which is choice of two basic drop down menu with another submit button which will send a email. The first page has a check box to allow the user to decide if they wish to allow the next page to display this dropdown menu. This all seem to work and I can echo all the $_POST but cannot echo any of the $send or $message. I am sure its to do with my if statement but after a day googling and page turning I cannot get this to send mail or get any of the $send or $message to echo. Any help would be appreciated. Thanks Mark. PHP5 WAMP 2 (code below) ps I know sheet numbers are back to front but that is a trival thing to sort as soon as code works unless I decide to hammer my delete button and hit the drink. ////////////////////customer sheet 2////////////////////////// if ($_POST[fType]=="2" && $_POST[checkbox] = "check") { echo $JS_Email; //displays my html dropdown box and submit button //$_POST[func] is the check box description of problem if ($_POST[func] == "qua") //quality responce { $send = "[email protected]"; $message = "Thank you "; } //mis_order response else if ($_POST[func] == "misord") { $send = "[email protected]"; $message = "Thank you"; } //mis_ship responce else if ($_POST[func] == "misship") { $send = "[email protected]"; $message = "Thank you"; } //mis_sell sheet else if ($_POST[func]=="missell") { $send = "[email protected]"; $message = "Thank you"; } //customer has failed delivery else if ($_POST[func]=="fail") { $send = "[email protected]"; $message = "Thank you"; } //we have agreed a restock fee else if ($_POST[func]=="restock") { $send = "[email protected]"; $message = "Thank you"; }} /////////////////customer sheets 1////////////////////////////// else if ($_POST[fType] =="1" && $_POST[checkbox] = "check") { echo $Main_Email; //displays my html dropdown box and submit button if ($_POST[func] == "qua") { $send = "[email protected]"; $message = "Thank you"; } //mis_order response else if ($_POST[func] == "misord") { $send = "[email protected]"; $message = "Thank you"; } //mis_ship responce else if ($_POST[func] == "misship") { $send = "[email protected]"; $message = "Thank you "; } //mis_sell sheet else if ($_POST[func]=="missell") { $send = "[email protected]"; $message = "Thank you "; } } $msg = "email sent from: me\n"; $msg .="senders email: $send\n"; $msg .="message: $message\n"; // should pull from cust email from sheet $to=$fEmail; $subject="mine"; $mailheaders="From: me<$send>\n"; $mailheader.="Reply-To: $fEmail\n"; mail($to, $subject, $msg, $mailheaders); ?> php 5 WAMP 2 Link to comment https://forums.phpfreaks.com/topic/129275-if-in-if-used-to-send-email/ Share on other sites More sharing options...
aeonsky Posted October 20, 2008 Share Posted October 20, 2008 Shouldn't you change the 2nd and the 44th line to... $_POST[checkbox] == "check" The line below always evaluates to true... $_POST[checkbox] = "check" Link to comment https://forums.phpfreaks.com/topic/129275-if-in-if-used-to-send-email/#findComment-670232 Share on other sites More sharing options...
spillage Posted October 20, 2008 Author Share Posted October 20, 2008 yes that was just a typo and the orignal code is == cheers Link to comment https://forums.phpfreaks.com/topic/129275-if-in-if-used-to-send-email/#findComment-670239 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.