Refer a Friend
Simple Refer a Friend script. Save this script as "refer.php".
<?php
$status="Refer a Friend :";
$subject="Great website I have found !";
$test=$HTTP_POST_VARS["ftest"];
$name=$HTTP_POST_VARS["fname"];
$mail = array ($HTTP_POST_VARS["fmail1"], $HTTP_POST_VARS["fmail2"],
$HTTP_POST_VARS["fmail3"] );
$comment=$HTTP_POST_VARS["fcomment"];
$body=$comment."\n".$name;
if ($test=="1"){
for ( $k=1; $k<=3; $k++ ){
mail($mail[$k],$subject,$body);}
$status="Thank you !";}
?>
<html><head>
<title>Refer a Friend Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head><body>
<form name="form1" method="post" action="refer.php">
<table width="75%" border="0" cellpadding="4" cellspacing="0" bgcolor="#EEEEEE">
<tr> <td width="30%"> </td>
<td width="70%"><?php print $status; ?></td>
</tr><tr>
<td width="30%"><div align="right">Your Name :</div></td>
<td width="70%"><input name="fname" type="text" id="fname"></td>
</tr><tr>
<td> </td>
<td>Tell these friends about our website :</td>
</tr><tr>
<td width="30%"><div align="right">E-Mail 1 : </div></td>
<td width="70%"><input name="fmail1" type="text" id="fmail1"></td>
</tr> <tr>
<td><div align="right">E-Mail 2 : </div></td>
<td><input name="fmail2" type="text" id="fmail2"></td>
</tr> <tr>
<td><div align="right">E-Mail 3 : </div></td>
<td><input name="fmail3" type="text" id="fmail3"></td>
</tr><tr>
<td width="30%"><div align="right">Comment : </div></td>
<td width="70%"><textarea name="fcomment" id="fcomment">Hi,
I have found an interesting website.
Hope you will like it, too.
Regards,</textarea></td>
</tr> <tr>
<td width="30%"> </td>
<td width="70%"><input type="submit" name="Submit" value="Submit"> <input name="ftest"
type="hidden" id="ftest" value="1"></td>
</tr></table></form></body></html>