Greetings and salivations, um - salutations? Yea - that's it. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /><br /><br />I have a basic form on a site that uses php to put the info into a mysql table. Form gets filled out, click to submit ( <form .... method="post" action="/dothis.php" onsubmit="return checkform(this) && checkCheckBoxes(this) && isValid();"...etc> )and no further action is required on the users part. The info reappears on the thankyou page and the info goes into database for display elsewhere. I know - nothing new here.<br /><br />Or here, but my question : is there an <b>easy</b> method to get an email sent to me when that form is submitted? (I'm having one of those <i>"I know I've seen it somewhere.."</i> moments...)<br /><br /><br />Thanks<br /><br />[edit] I should say easy and <i>safe</i> method<!--content-->
Since the info is sent to a thank you page<br />why not use php mail() to send the info to yourself just before going to the thank you page <br /><br /><?php<br /> mail($myemail, $subject, $message, $from);<br />?><br /><br />You can set $message equal to all the data you need to see.<!--content-->
Thanks Don<br /><br /><!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->You can set $message equal to all the data you need to see.<!--QuoteEnd--></div><!--QuoteEEnd--> <br /><br />I'm having trouble making this work. Defining $message that is. I tried putting everything in here first (predefining $myemail and $subject earlier) :<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?php<br />mail($myemail, $subject, $first_name, $last_name, $phone, $email);<br />?><!--c2--></div><!--ec2--> <br /><br />but it ceased to work after adding the 5th ($last_name) element. I tried predefining $message as an array also (which is probably just wrong anyway <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/blush.gif" style="vertical-align:middle" emoid=":blush:" border="0" alt="blush.gif" /> ) and that didn't work either.<br /><br />I shuld mention though that it does indeed work up to that point. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /><!--content-->
Ty: what about <a href="http://www.surefirewebdesign.com/scripts/" target="_blank">Ultimate Form Mail</a>? Would this work for your particular application?<!--content-->
No you need to keep the format<br /><?php<br />mail($myemail, $subject, $message, $from);<br />?><br /><br /><br />So try this using Heredoc to build the $message<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?php<br />$myemail ="me@mysite";<br />$subject = "new database entry";<br /><br />$message = <<< EOF<br />New entry to database<br />Name: $first_name  $last_name <br />Phone: $phone <br />email: $email<br />EOF;<br /><br />$from = "From: $email\r\n";<br /><br />// send mail<br />mail($myemail, $subject, $message, $from);<br />?><!--c2--></div><!--ec2--><!--content-->
Thanks - I'll try that. This is sooooo close to what I kept calling "predefining". This is page 74 of my O'Reilly's too. Sitting right here next to me and I didn't find it. Durr <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/tongue.gif" style="vertical-align:middle" emoid="" border="0" alt="tongue.gif" /><br /><br />Thanks for the suggestion Steve, I'm not sure UFM would work for this but I may end up revisiting the option. (I think only the paid version writes to database, not sure)<!--content-->
Boxturt,<br /><br />Thanks for the card. I really enjoyed reading it. My son is using the pick everyday to play.<br /><br />Bill<!--content-->
You're welcome - thank <i>you!!</i> I'm glad he's giving it a try <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /><br /><br />BTW - the ' HEREDOC ' did the trick, thank you. I like php and I know I'll be better at it once I learn what things are called!!<!--content-->
<img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/thumbup1.gif" style="vertical-align:middle" emoid=":thumbup1:" border="0" alt="thumbup1.gif" /><!--content-->
Since the info is sent to a thank you page<br />why not use php mail() to send the info to yourself just before going to the thank you page <br /><br /><?php<br /> mail($myemail, $subject, $message, $from);<br />?><br /><br />You can set $message equal to all the data you need to see.<!--content-->
Thanks Don<br /><br /><!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->You can set $message equal to all the data you need to see.<!--QuoteEnd--></div><!--QuoteEEnd--> <br /><br />I'm having trouble making this work. Defining $message that is. I tried putting everything in here first (predefining $myemail and $subject earlier) :<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?php<br />mail($myemail, $subject, $first_name, $last_name, $phone, $email);<br />?><!--c2--></div><!--ec2--> <br /><br />but it ceased to work after adding the 5th ($last_name) element. I tried predefining $message as an array also (which is probably just wrong anyway <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/blush.gif" style="vertical-align:middle" emoid=":blush:" border="0" alt="blush.gif" /> ) and that didn't work either.<br /><br />I shuld mention though that it does indeed work up to that point. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /><!--content-->
Ty: what about <a href="http://www.surefirewebdesign.com/scripts/" target="_blank">Ultimate Form Mail</a>? Would this work for your particular application?<!--content-->
No you need to keep the format<br /><?php<br />mail($myemail, $subject, $message, $from);<br />?><br /><br /><br />So try this using Heredoc to build the $message<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?php<br />$myemail ="me@mysite";<br />$subject = "new database entry";<br /><br />$message = <<< EOF<br />New entry to database<br />Name: $first_name  $last_name <br />Phone: $phone <br />email: $email<br />EOF;<br /><br />$from = "From: $email\r\n";<br /><br />// send mail<br />mail($myemail, $subject, $message, $from);<br />?><!--c2--></div><!--ec2--><!--content-->
Thanks - I'll try that. This is sooooo close to what I kept calling "predefining". This is page 74 of my O'Reilly's too. Sitting right here next to me and I didn't find it. Durr <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/tongue.gif" style="vertical-align:middle" emoid="" border="0" alt="tongue.gif" /><br /><br />Thanks for the suggestion Steve, I'm not sure UFM would work for this but I may end up revisiting the option. (I think only the paid version writes to database, not sure)<!--content-->
Boxturt,<br /><br />Thanks for the card. I really enjoyed reading it. My son is using the pick everyday to play.<br /><br />Bill<!--content-->
You're welcome - thank <i>you!!</i> I'm glad he's giving it a try <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /><br /><br />BTW - the ' HEREDOC ' did the trick, thank you. I like php and I know I'll be better at it once I learn what things are called!!<!--content-->
<img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/thumbup1.gif" style="vertical-align:middle" emoid=":thumbup1:" border="0" alt="thumbup1.gif" /><!--content-->