by Hiroshi on June 16th, 2008
Recommend a page or website to a friend PHP script tutorial and script download.
Form Script
<form name=refer action="refer.php" method="POST"> <td align="center" valign="middle"><table width="600" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="30" colspan="2"><strong>Your Details</strong></td> </tr> <tr> <td height="30">Name: <input name="fromName" type="text" id="fromName"></td> <td height="30">E-Mail: <input name="fromEmail" type="text" id="fromEmail"></td> </tr> <tr> <td height="30" colspan="2"><strong>Friends Details</strong></td> </tr> <tr> <td height="30">Name: <input name="toName" type="text" id="toName"></td> <td height="30">E-Mail: <input name="toEmail" type="text" id="toEmail"></td> </tr> <tr align="center"> <td height="30" colspan="2"><input type="submit" name="Submit" value="Refer"></td> </tr> </table></td></form>
Referer Page Script
<?php $fromName=$_REQUEST["fromName"]; $fromEmail=$_REQUEST["fromEmail"]; $toName=$_REQUEST["toName"]; $toEmail=$_REQUEST["toEmail"]; if ($fromEmail) { $ref=getenv('HTTP_REFERER'); if ($fromName=='') $subject= "Your friend has referred you this link from www.sitename.com"; else $subject= "$fromName has referred you this link from www.sitename.com"; $message = " Dear $toName, Your friend $fromName has referred this link to you. Please visit this link by clicking $ref "; $from = "From: $fromEmail\r\n"; mail($toEmail, $subject, $message, $from); header ("location:".$ref); } ?>
Put this script in some page and save it as referer.php and you are done.
Referrer, Recommend To A Friend PHP Script
php codes, php scripts, Referrer, Scripts
6 Reviews
Leave a Review
Incoming Searches
tellafriend php, tell a friend php, recommend to a friend php, wordpress posts tell a friend script, tell a friend php ajax script free, tell a friend only with subject, tell a friend king, tell a friend june subject, tell a friend function php, tell a friend book, tell a friend at subject, tell a friend about this books, site recommend php, sendpage/friend ph id, tell a friend php script validation captcha, tell a friend protect with subject, toName toEmail php form, tellafriend/inbox, TellaFriend derictory subject, Tell-a-friend referral form php script, tell-a-friend php, tell your friends php script with example, tell afriend management subject, tell a friend with subject, tell a friend with referer link, Tell A Friend system subject, tell a friend script using ajax and php, tell a friend script capchat, send to friend sendpage subject, send to friend refer subject, php script send page to a friend, net tellafriend with subject, inurl:tell-a-friend php message, how to create save referrer with php, happier tellafriend with subject, free download php script refer friend with captcha, email a friend form, com/friend/send-to-friend php, com TellAFriend with subject, ajax tell a friend form CAPTCHA, /tellafriend php, /recommend php sites, php share with a friend, php tutorial how to call referrer script, send to friend php up subject, script tell a friend bcc, script referrer, referfriends names with subject, referfriend names subject, refer friends bcc, refer a friend php with subject, recommend this site php, recommend a page script, recommand this site php, recomend site php, phpmagic tutorial, $_REQUEST[pmb]



This is a great website!
awesome site!
I can’t get this form to work in an email sent in htm format. I’d like to send the referral form in my e-mails.
There is a change in the code if this is not working:
You have to just call previous page URL correctly and request all variables too:
Try this and the code should work fine.
Use referer as like this:
$ref=getenv(‘HTTP_REFERER’);
This should call previous URL right, incase Globals are off in PHP.ini.
and request variables from previous page as like these:
$fromEmail=$_REQUEST["fromEmail"];
$fromName=$_REQUEST["fromName"];
$toName=$_REQUEST["toName"];
$toEmail=$_REQUEST["toEmail"];
So the above PHP code becomes like:
< ?php
if ($fromEmail)
{
$ref=getenv('HTTP_REFERER');
$fromEmail=$_REQUEST["fromEmail"];
$fromName=$_REQUEST["fromName"];
$toName=$_REQUEST["toName"];
$toEmail=$_REQUEST["toEmail"];
if ($fromName=='')
$subject= "Your friend has referred you this link from http://www.sitename.com“;
else
$subject= “$fromName has referred you this link from http://www.sitename.com“;
$message = ”
Dear $toName,
Your friend $fromName has referred this link to you.
Please visit this link by clicking $ref
“;
$from = “From: $fromEmail\r\n”;
mail($toEmail, $subject, $message, $from);
header (“location:”.$ref);
}
?>
If you are saying that you want to send HTML supported emails then you need to see MIME TYPES headers for email. These are required for that before sending email:
$headers = ‘MIME-Version: 1.0′ . “\r\n”;, Kelly ‘ . “\r\n”;‘ . “\r\n”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1′ . “\r\n”;
$headers .= ‘To: Mary
$headers .= ‘From: Birthday Reminder
$headers .= ‘Cc: someothername@example.com‘ . “\r\n”;
$headers .= ‘Bcc: anothername@example.com‘ . “\r\n”;
Check the following links:
http://www.phpmagicbook.com/ph.....php-email/
and
http://www.phpmagicbook.com/up.....mat-email/
Happy coding
most mail goes to junk/spam mail can we get out of it or there is any php code…
@net biz: There are two things. Email from where that email is coming from to you? Do not use user’s email. Use info@yourserver.com kind of email or any email that is set at your webhost. Second thing is concentrate. When email arrives in inbox, it has a name, email and subject. Make sure these are right. Email is important. If the server recognizes the right email it will not go in spam. Make the email which you have at your web host not spam in your inbox.