Jump to content


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


PHP processing Question

Recommended Posts

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:

$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....Thanks


Share this post

Link to post
Share on other sites
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;
    echo 'Could not send email.';

Share this post

Link to post
Share on other sites
This topic is now closed to further replies.


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.