The script is printed below (where you see http://yoursite.com I want to introduce a relative URL - index.htm):
<?PHP
// Taming The Beast Tell-A-Friend script V 1.1
// Taming the Beast.net - http://www.tamingthebeast.net
// Free Web Marketing and Ecommerce Resources
// By using this code you agree to indemnify
// Taming the Beast from from any liability that might arise // from it's use.
This section removes any nasty tags that the
user may have entered in the form fields
strip_tags($friendmail1);
strip_tags($friendmail2);
strip_tags($friendmail3);
strip_tags($email);
strip_tags($name);
This section sends you a notification email when
the form is used
// Your email address (for copies to be sent to you)
$emailto = "you@yourdomain.com";
// Your email subject text
$esubject = "a page has been sent";
// The email text for copies sent to you
$emailtext = "
".$name." has used the tell-a-friend form. Their email address is ".$email."
The people they have recommended are:
".$friendmail1."
".$friendmail2."
".$friendmail3."
";
Send the email to you
@mail("$emailto", $esubject, $emailtext, "From: $email");
This section sends to the recipients
// Target page after successful submission
$thankyoupage = "thankyou.htm";
// Change the subject text below to suit
$tsubject = "A great site";
// Change the text below for the email
$ttext = "
Hi,
A friend or colleague of yours, ".$name.", whose email address is ".$email." thought you may like to visit our site. ".$name." has used our Tell-a-Friend form to send you this email.
http://www.yoursite.com
";
This sends the email to the addresses entered
@mail("$friendmail1 $friendmail2 $friendmail3", $tsubject, $ttext, "FROM: $email");
After submission, the target URL
header("Location: $thankyoupage");
exit;
?>