dsartain Posted March 6, 2006 Share Posted March 6, 2006 Hey, I've made a page that will process a form I posted on myspace, the page updates the DB fine, but I also want it to email me when it processes the form. How can I do this? PHP code below:<?php$name = addslashes($_POST['name']);$occupation = addslashes($_POST['occupation']);$myspace = addslashes($_POST['myspace']);$website = addslashes($_POST['website']);$dbconn = mysql_connect("localhost","dsartain","marines"); mysql_select_db("db_mysql",$dbconn); $query = "INSERT INTO `model_websites` VALUES('','$name','$occupation','$myspace','$website')";$runquery = mysql_query($query,$dbconn);if (!$runquery) {$query_result= 'Query Failed'; } else {$query_result= 'Thank You For Your Submission!!!';}?>I'm not displaying it so I haven't added the stripslashes yet...If you can help me with this please EMAIL me at dsartain18@yahoo.com for some reason I'm not getting emails when someone replies to my posts...fix that later....ThanksDon Link to comment Share on other sites More sharing options...
php_b34st Posted March 6, 2006 Share Posted March 6, 2006 You could use something like this:[code]//send email$email = "email address email is to be sent to";$from = "who is the email from";$mesg = "message you would like to send";$subject = "email subject"; if (mail($email, $subject, $mesg, $from))return true; else{ echo 'Could not send email.';}[/code] Link to comment Share on other sites More sharing options...
Recommended Posts