Hello, i have been looking for and answer on the internet but i couldn't find it! I'm new on PHP based on and example i wrote something like this for my website:
//basic variables
$EmailFrom = Trim(stripslashes($_POST['EmailFrom']));
$EmailTo = "example@mysite.org";
$Subject = "Registration u10";
$teamname = Trim(stripslashes($_POST['teamname']));
$affiliation = Trim(stripslashes($_POST['affiliation']));
$premier = Trim(stripslashes($_POST['premier']));
$challenge = Trim(stripslashes($_POST['challenge']));
$girls = Trim(stripslashes($_POST['girls']));
$boys = Trim(stripslashes($_POST['boys']));
//about 15 more variables go in here but i don't want to put them to save some space
// validation
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// email body text
//this includes the info of all the variables at the top even the ones I didn't write in here (but you get the point )
$Body = "";
$Body .= "Team Name: ";
$Body .= $teamname;
$Body .= "\n"; $Body .= "\n";
$Body .= "AYSleague: ";
$Body .= $aysleague;
$Body .= "\n"; $Body .= "\n";
$Body .= "Flash Tournament: ";
$Body .= $flashtournament;
$Body .= "\n"; $Body .= "\n";
$Body .= "Spring 2011: ";
$Body .= $spring2011;
$Body .= "\n"; $Body .= "\n";
$Body .= "Summer 2011: ";
$Body .= $summer2011;
$Body .= "\n"; $Body .= "\n";
$Body .= "fall 2011: ";
$Body .= $fall2011;
$Body .= "\n"; $Body .= "\n";
// send email to my inbox with the information above
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// if everything goes OK it will redirect them to another page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=thanksu12.html\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
}
?>
the problem that i have is:
(i divided it in 2 sections)
1- i need to sent a second email to the coach
2- that email only needs to have the information of 6 variables not the whole thing
I don't know how to do it, if someone knows how to do it, i will appreciate some help!!
thanks!