o0slowpaul0o
New Member
- Messages
- 254
- Reaction score
- 0
- Points
- 0
Before I be gone for a long while, I will be back so Admins please don't delete me.
Anyway.
Open up a text editor and put this code in:
Save it as tell.php
To show it on your webpage put this code some where in your page:
Demo: http://silverstorm-design.net/tell.php
Anyway.
Open up a text editor and put this code in:
Code:
<!--Tell a Friend By o0slowpaul0o Of x10Hosting-->
<html><head>
<title>Tell a Friend By o0slowpaul0o Of x10hosting</title>
<?php
$sub="Check Out this Website"; //Subject of the message
$link1=getenv(HTTP_HOST);
$link2=${PHP_SELF};
$link="http://$link1$link2";
?>
<script language="JavaScript"><!--
function openbox(){
var MyWindow;
var MyUrl;
MyUrl = 'tell.php?mce=send_link&url=<?php echo $link; ?>';
MyWindow = window.open(MyUrl, "Tell", "STATUS=NO,TOOLBAR=NO,LOCATION=NO,DIRECTORIES=NO,COPYHISTORY=NO,MENU=NO,RESISABLE=NO,SCROLLBARS=NO,TOP=50,LEFT=20,WIDTH=600,HEIGHT=350,");
}
// --></script>
</head><body>
<?php
extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
if($mce==""){
$link1=getenv(HTTP_HOST);
$link2=${PHP_SELF};
$link="http://$link1$link2";
?>
<form onsubmit="javascript:{return false;}">
<input type=hidden name=link value=<?php echo "$link"; ?>>
<input type="submit" value="Tell a Friend" onclick="javascript:openbox();"></p>
</form>
<?php
}
if($mce=="send_link"){
$link1=getenv(HTTP_HOST);
$link2=${PHP_SELF};
$link="http://$link1$link2";
echo"<CENTER><font face=arial>Tell Your Friends</font></CENTER><form method=post action=?mce=tell_friend>
<table><tr><td>* Your Name:</td><td><input type=text name=name></td><td>* Your Email:</td><td><input type=text name=email></td></tr><tr><td>* Friend's Name:</td><td><input type=text name=name1></td><td>* Friend's Email:</td><td><input type=text name=email1></td></tr><tr><td>Friend's Name:</td><td><input type=text name=name2></td><td>Friend's Email:</td><td><input type=text name=email2></td></tr><tr><td>Friend's Name:</td><td><input type=text name=name3></td><td>Friend's Email:</td><td><input type=text name=email3></td></tr></table><table><tr><td width=21%>* Message:</td><td><textarea name=message rows=7 cols=46></textarea></td></tr><tr><td><input type=hidden name=web_link value=$url></td><td align=center><input type=submit value=' Send '></td></tr><tr><td>* = Required</td></tr></table>";
}
if($mce=="tell_friend"){
$subject="$sub";
if($email1!=""){
$to=$email1;
$mess = "From: $name\nHi $name1\n $message\nTo visit the website click the link below:\n$web_link\n";
$mailheaders="Return-path: $name <$email>\n";
$mailheaders.="From: $name <$email>\n";
$mailheaders.="Reply-To: $email\n";
$sent=mail(trim($to), $subject, $mess, $mailheaders);
if($sent){$recp1=$email1;}else{$recp1="";}
}
if($email2!=""){
$to=$email2;
$mess = "From: $name\nHi $name2\n $message\nTo visit the website click the link below:\n$web_link\n";
$mailheaders="Return-path: $name <$email>\n";
$mailheaders.="From: $name <$email>\n";
$mailheaders.="Reply-To: $email\n";
$sent=mail(trim($to), $subject, $mess, $mailheaders);
if($sent){$recp2=$email2;}else{$recp2="";}
}
if($email3!=""){
$to=$email3;
$mess = "From: $name\nHi $name3\n $message\nTo visit the website click the link below:\n$web_link\n";
$mailheaders="Return-path: $name <$email>\n";
$mailheaders.="From: $name <$email>\n";
$mailheaders.="Reply-To: $email\n";
$sent=mail(trim($to), $subject, $mess, $mailheaders);
if($sent){$recp3=$email3;}else{$recp3="";}
}elseif($email1=="" && $email2=="" && $email3==""){
echo "<table align=center valign=middle><tr><td valign=middle>You must specify atleast one of your friend's email</td></tr>";
echo "<tr><td align=center><input type=button value=\" Back \" onclick=\"javascript:history.back();\"></td></tr></table>";
}
if($email1!=""){
echo"<table align=center valign=middle><tr><td valign=middle>";
echo " Email has been sent to: <BR>$recp1<BR> $recp2<BR> $recp3</td></tr><tr>";
echo "<td valign=middle><input type=button value=\" Close Window \" onclick=\"javascript:window.close();\"></td></tr></table>";
}
}
?>
</body></html>
Save it as tell.php
To show it on your webpage put this code some where in your page:
Code:
<?php include "tell.php"; ?>
Demo: http://silverstorm-design.net/tell.php