Hi there,
I'm pretty new to PHP and at the moment, I'm just about managing to configure other people's scripts for my own purposes.
But I have a problem...
Basically, I have created a "tell a friend" script that people can use to recommend my website to other people. A person fills out an HTML form on my site, which then sends the requested info to my PHP script.
The script works fine, but at the moment it only sends the notification email to one single person.
I want the script to send the notification email not only to the requested person, but also to me (in a similar sort of way to cc'ing someone in on an email)
So my question is: How do I add a second recipient into my script?
At the moment, the script only sends the email to one person (in this case I have called them "$theiremail") I also want to send the message to a second person (called "$cc)
<?
$theirname = $REQUEST['theirname'] ;
$theiremail = $REQUEST['theiremail'] ;
$yourname = $REQUEST['yourname'] ;
$youremail = $REQUEST['youremail'] ;
$message = $REQUEST['message'] ;
$cc = $REQUEST['cc'] ;
if (!isset($_REQUEST['cc'])) {
header( "Location: http://www.imcoolerthanyou.com" );
}
elseif (empty($youremail) || empty($theiremail)) {
header( "Location: error.html" );
}
else {
mail( "$theiremail", "imcoolerthanyou.com",
"Dear $theirname, blah blah blah",
"From: $theirname <$theiremail>" );
header( "Location: thanks.html" );
}
?>
Thanks very much for your help, and apologies if this is rediculously simple, for experienced PHP'ers!