I created a web form in php that returns the form data to my email address. I have included the form below. What I would like to do now is have the form also send an email confirmation request to each of the three “Friends”. What is the php code to accomplish this?
<?php $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/")); session_start(); if( ($_SESSION['security_code']==$_POST['security_code']) && (!empty($_POST['security_code'])) ) { mail("[email protected]","Referral Form submission","Form data: Your name: " . $_POST['field_1'] . " Your Email: " . $_POST['field_2'] . " Friend's Name 1: " . $_POST['field_3'] . " Friend's EMail 1: " . $_POST['field_4'] . " Friend's Name 2: " . $_POST['field_5'] . " Friend's EMail 2: " . $_POST['field_6'] . " Friend's Name 3: " . $_POST['field_7'] . " Friend's EMail 3: " . $_POST['field_8'] . " powered by me. "); include("confirm.html"); } else { echo "Invalid Captcha String."; } ?>Hmmmm… this is a pretty advance script here and what you are asking is not anywhere as advanced as what is written above. Could you attempt to write the code for what you are asking then come to us with your code if you have trouble and we can assist you with your errors?
The process is well documented here:
http://www.phphelp.com/tutorial/using-php-to-generate-and-send-mail.html
or you can simply answer the question.
After the names, just do another mail mail call with that person’s email in the address part.
sorry richei if you felt I did not help but this was simply an attempt for free work. This script that was written and has been used before, it is not dandudes he took credit for it though. There was two things wrong here which is why I did not give him a legit answer to his problems.
It is rude to take someone elses code and claim it as your own.
Then to try to come here and get free work on some project which you are most likely going to get paid for.
This is a forum to recieve help with you learning or having problems with php
This is not a “come and get your free programming done here” site.
This code was first used 4 years ago
then again 2 years ago
http://www.codingforums.com/archive/index.php/t-212581.html
I did not help him because I took offense to him trying to pass this off as his work. I could tell that if he really wrote THAT advanced of php then he would have known how to write a simple mail() addition to it!!
This is not something a noob would write:
[php]//".$_SERVER[‘SERVER_NAME’].strrev(strstr(strrev($_SERVER[‘PHP_SELF’]),"/"));[/php]
Please if you come to the site do not look for a free programmer!!! There is sites where you can hire one if you do not have any interest in learning it yourself.
Its not something an experienced programmer would write either He said he coded the form, not the script part (thought i guess it could be taken as that). Either way, its not a good practice to try and pass code off as your own, but with the way the web is, it happens from time to time. If he had gone down a bit further, he would’ve ended up with the solution
To answer the question, do this
[php]