Personal Development for Smart People Forums

Personal Development for Smart PeopleTM Forums

 

Go Back   Personal Development for Smart People Forums > Personal Development > Technology & Technical Skills

Notices

Technology & Technical Skills Computer skills, hardware, software, internet topics, gadgets, programming

Reply
 
Thread Tools Display Modes
Old 03-04-2007, 12:31 AM   #1 (permalink)
Junior Member
 
Join Date: Mar 2007
Posts: 25
Vahid is an unknown quantity at this point
Thumbs up Recommend Us Script

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!

PHP 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>
Vahid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-05-2007, 03:18 PM   #2 (permalink)
Senior Member
 
Join Date: Mar 2007
Posts: 105
DarkSociologist is on a distinguished road
Default

Nice script. Having an email sent out to your friends is definitely a good promotional tool. This would be especially useful if it was easy to embed in a blog, following each post.

It's hard to tell by just looking at the code, but it seems like you only recommend a pre-defined address "http://www.yourURL.com" A feature that I would like to see is that the script dynamically grabs the page url. That way you can send your friend a specific story from a blog, rather than the generic home page.
DarkSociologist is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-06-2007, 12:06 AM   #3 (permalink)
Junior Member
 
Join Date: Feb 2007
Posts: 6
Damon is on a distinguished road
Default

Thanks Vahid,

That is a nice script. I added it to the bottom of each of my blog posts, and even in my sidebar. You can see an example here:

Professionals have coaches, amateurs do not

However, during my testing, it's not sending an email to the address that I put in there. Is there something else I have to edit?
Damon is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-06-2007, 03:15 PM   #4 (permalink)
Junior Member
 
Join Date: Feb 2007
Posts: 6
Damon is on a distinguished road
Default

I'm still not able to have the email send the email address I put in the field.

I use yahoo webhosting. Is there something in the code that I need to update for this to happen?

I've also added my header to my recommend page, here is the actual page:

Recommend DamonClifford.com To Your Friends
Damon is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-06-2007, 03:28 PM   #5 (permalink)
Senior Member
 
Join Date: Mar 2007
Posts: 105
DarkSociologist is on a distinguished road
Default

Quote:
Originally Posted by Damon View Post
I'm still not able to have the email send the email address I put in the field.

I use yahoo webhosting. Is there something in the code that I need to update for this to happen?

I've also added my header to my recommend page, here is the actual page:

Recommend DamonClifford.com To Your Friends
Some servers don't allow sendmail because of the abuse potential (like you can create a mail bomb script). Yahoo would probably be a good candidate for something like that.

I would also try changing "Return-Path:" to simply "To:" and see if that does anything.
DarkSociologist is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-06-2007, 11:43 PM   #6 (permalink)
Junior Member
 
Join Date: Feb 2007
Posts: 6
Damon is on a distinguished road
Default

Thanks for the tip DarkSociologist,

I changed it, and it still doesn't seem to work correctly. I'll look into it more.
Damon is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can anyone recommend a good traffic log analyzer? Scorpio Technology & Technical Skills 9 03-09-2008 09:51 AM
Simpleology jbischke Personal Effectiveness 4 03-02-2007 02:37 PM
FrontPage Server Extension Gordon Technology & Technical Skills 2 02-08-2007 08:08 AM
Recommend a bathroom scale? Cron Health & Fitness 12 01-25-2007 09:06 PM
Script for Email Ibanez Technology & Technical Skills 1 11-16-2006 07:37 PM


All times are GMT. The time now is 08:46 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2010 by Pavlina LLC