20, July 2008

Recommend Us Script - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Recommend Us Script
« previous next »
Pages: [1] Print

Author Topic: Recommend Us Script  (Read 785 times)
Raped By Google
*
Posts: 28
196 credits
Members referred : 0



« on: Mar 03, 2007, 11:20:02 PM »

Hi,

Recommend us script is one of the effective viral marketing tools. It is highly "recommended" to have a recommend us page and let visitors refer others to your website.

Here is the recommend us script I have created. You just need to replace the YourURL with your own domain name. Enjoy!

Code:

<?
////////////////////////////////////////////////////////////////////////////////////
//This script is creadted by Vahid Chaychi at http://www.weboma.com //
//You need to customize it for your website. The only thing you need //
//to do is replacing the YourURL.com with your website URL. //
////////////////////////////////////////////////////////////////////////////////////
if($_SERVER['HTTP_REFERRER'] == NULL){
$sitename = 'http://www.YourURL.com';
} else {
$sitename = $_SERVER['HTTP_REFERRER'];
}
if($_POST['email']){
$address = $_SERVER['REMOTE_ADDR'];
$yourname = $_POST['yourname'];
$youremail = $_POST['youremail'];
$email = $_POST['email'];
$message = $_POST['message'];
if($message != 'NA'){
$come = '<p align="justify"><b> ' . $message . '</font> </b></p>';
}
$themessage = '
<p>Hello,</p>
<p align="justify">Your friend <b><u>' . $yourname . '</u></b> has sent you an invitation to visit our site.</p>
<p align="justify">Please visit our site at: <a href="' . $sitename . ' " target="_blank">http://www.YourURL.com</a></p>
<p align="justify">Your friend also attached a message, which was:</p><hr color="#FF0000" width="80%" align="left" size="1"><p><b>' . $come . '</b></p><hr color="#FF0000" width="80%" align="left" size="1">
<p>Very truly yours,<br>YourURL.com<br>-------------------------------------</p>
<p><b>Note:</b><br>
' . $yourname . ' IP address is <u>' . $address . '</u>.</p>
';
$subj= "A Message From: " . $yourname . " ";
$header = "Return-Path: " . $email . "\r\n";
$header .= "From: $yourname <" . $youremail . ">\r\n";
$header .= "Content-Type: text/html; charset=iso-8859-1;\n\n\r\n";

@mail ($email,"$subj",$themessage,$header);
$message2 = '<font size="2" face="Arial"><b>Thank You For Recommending YourURL To Your Friends!</b></font><br>
<font size="2" face="Arial">You can use the form again to recommend us to your other friends.</font><br>
';
}
?>
<html>
<head>
<title>Recommend YourURL.com To Your Friends</title>
</head>
<body topmargin="0" leftmargin="0">
<br><br><br>
<form action="<? echo $_SERVER['PHP_SELF'];?>" method="post" name="tellfrnd" id="tellfrnd" onSubmit="return validatetell(this)">
<p style="margin-left: 110">
<?
if($message2 != NULL){
echo $message2; } ?>
</p>
<hr color="#FF0000" size="1" width="90%">
<div align="center">
<center>
<table width="723" border="0" cellpadding="2" height="1">
<tr>
<td width="715" height="22" colspan="3">
<p style="margin-left: 5">
<font size="4" color="#0683FF"><b>Recommend YourURL.com To Your Friends &amp; Partners:</b></font></td>
</tr>
<tr>
<td width="202" height="22">
<p align="right"><b><font face="Arial" size="2">Your Name:</font></b></td>
<td width="513" height="22" colspan="2">
<input name="yourname" type="text" id="yourname" size="28"></td>
</tr>
<tr>
<td width="202" height="1" valign="middle">
<p align="right"><b><font face="Arial" size="2">Your Email
Address:</font></b></td>
<td width="513" height="1" colspan="2">
<input name="youremail" type="text" id="email" size="28"></td>
</tr>
<tr>
<td width="202" height="1" valign="middle">
<p align="right"><b><font face="Arial" size="2">Your Friend's Email
Address:</font></b></td>
<td width="513" height="1" colspan="2">
<input name="email" type="text" id="email" size="28"></td>
</tr>
<tr>
<td width="202" height="1" valign="top">
<p align="right"><b><font face="Arial" size="2">Your Message:</font></b></td>
<td width="513" height="1" valign="top" colspan="2">
<textarea name="message" id="message" rows="5" cols="42"></textarea></td>
</tr>
<tr>
<td height="24" width="202">
<p align="center">&nbsp;</td>
<td width="351" height="24">
<p align="center">
<input name="Submit" type="submit" id="Submit" style="background-color:#FFFFFF;font-weight:bold;color:#0065CE;font-size:8pt; font-family:Arial" value="Submit The Form"></strong></font></td>
<td width="157" height="24">&nbsp;</td>
</tr>
</table>
</center>
</div>
</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p align="center"><b><font size="1" face="Arial">
<a target="_blank" href="http://www.YourURL.com/">www.YourURL.com</a></font></b></p>
</body>
</html>
<script>
function validatetell(object){
var valid = true;
if(object.yourname.value == 0){
alert("Please Enter Your Name!");
object.yourname.focus();
return false;
}
if (object.email.value.indexOf("@")==-1 || object.email.value.indexOf(".")==-1 || object.email.value.indexOf(" ")!=-1 || object.email.value.length<6){
alert("Please Enter At Least One Valid Email!");
object.email.focus();
return false;
}
if(object.message.value == 0){
object.message.value = 'NA';
}
return valid;
}
</script>


Cheers!
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7970
40777 credits
Members referred : 3



« Reply #1 on: Mar 03, 2007, 11:22:43 PM »

Wow, I had a lot of time to see a new member contributing to the community Smiley

Thanks for the snippet Vahid, and welcome to webdigity Wink

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Raped By Google
*
Posts: 28
196 credits
Members referred : 0



« Reply #2 on: Mar 06, 2007, 12:05:44 AM »

Wow, I had a lot of time to see a new member contributing to the community Smiley

Thanks for the snippet Vahid, and welcome to webdigity Wink


Thank you too. This is my pleasure to be a member of your community. I try to be more active.  Smiley
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7970
40777 credits
Members referred : 3



« Reply #3 on: Mar 06, 2007, 10:13:41 AM »

Thank you too. This is my pleasure to be a member of your community. I try to be more active.  Smiley

Good Wink BTW you can change the above part of your script :

if($_SERVER['HTTP_REFERRER'] == NULL){
$sitename 'http://www.YourURL.com Visit through proxy';
} else {
$sitename $_SERVER['HTTP_REFERRER'];
}


to this :


$sitename 'http://' $_SERVER['HTTP_HOST'] . '/' ;
}

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #4 on: Mar 13, 2007, 08:26:04 AM »

thank you for sharing Vahid. so are you from India?


Last blog : Cabilao Island, Bohol, Philippines
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6149
Tags : php recommend us script Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Recommend Us Script
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Jul 20, 2008, 06:26:55 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 35.668
Total Topics: 7.373
Total Members: 3.693
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: talelmouaada

12 Guests, 2 Users online :

5 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.