Results 1 to 2 of 2
Sep 6, 2001, 17:42 #1
is there a tell-a-friend tutorial in php?
I want to write my own tell-a-friend script in php... is there a tutorial to get me started??
Sep 6, 2001, 23:28 #2
- Join Date
- Jun 2001
- 0 Post(s)
- 0 Thread(s)
Sounds easy enough. Get the host $HTTP_HOST and the php page $PHP_SELF, and pass it to a function that contains a call to the mail function.
You could add additional parameters i.e your name, their name.
$disPage = $HTTP_HOST . $PHP_SELF;
$urmail = "email@example.com";
$dermail = "firstname.lastname@example.org";
function refer2friend($yourmail, $theirmail, $page)
if(is_email($yourmail) && is_email($theirmail))
$subject = "$yourmail thinks you should see $page";
$message = "Hi $theirmail,\n" .
"$yourmail thinks the following page may be of interest to you:\n" .
mail("$theirmail", "$subject", $message,"From: yourmail");
} //end if