TestClear

Author Topic: Customizing "Tell A Friend" script  (Read 28485 times)

Offline MeanPony

  • Supporter
  • **
  • Posts: 2
  • Karma: +0/-0
    • http://www.meanpony.com
Customizing "Tell A Friend" script
« on: October 31, 2007, 11:56:28 PM »

Greetings

Have recently been testing your "Tell a Friend" & the "Recommendation" scripts.
After setting some of the variables in the config.php with some success, i still can't get past a few bugs.
(have attempted editing the other files to customize for our local setup, also with some limited success)

The admin notification email is fine--all headers & text seems correct, however, the email that is sent to a friend
has some "errors" the "From line" is not the sender's email, but from System Admin
& the subject line isn't picking up name of the sender

1) From: System Admin <noreply@.......>
2) Subject: Online Wedding AlbumMessage from

check it here:
http://www.metatagen.com/tella/index.php
3) also, i'd like "Tell a Friend" email to link back to an external web page on a mac.com account, here:
http://.... 02007.html

rather than the meanpony.com domain where the "Tell a Friend" script resides.
Can't run php scripts on mac.com, so i'm using my site to host the php script files.

i'll add a pop-up window link like your "recommendation" script to the mac.com page
that we want to be sharing with the "Tell a friend" script, when i get this sorted out.
Hope this is practical/possible--Can we make this work? hosting the script on my domain
& "Telling a Friend" with link back to the mac.com page.

thanx in advance for any help or advice!
here's hoping that i've adequately explained my issues & apologies for my php ignorance,
sWitt @ meanpony.com



« Last Edit: September 27, 2008, 04:14:27 AM by admin »

Elwood

  • Guest
Re: Customizing "Tell A Friend" script
« Reply #1 on: November 01, 2007, 05:25:24 AM »
In maile.php

Code: [Select]
$headers .= 'From: System Admin <noreply@domain.com>' . "\r\n";
replace with

Code: [Select]
$headers .= "From: $say" . "\r\n";

 8) 8)


« Last Edit: May 25, 2008, 05:20:04 PM by admin »

Offline MeanPony

  • Supporter
  • **
  • Posts: 2
  • Karma: +0/-0
    • http://www.meanpony.com
Re: Customizing "Tell A Friend" script
« Reply #2 on: November 01, 2007, 08:51:58 AM »
Excellent

1)   ;D  thanx Elwood!, your posted edit to "maile.php" fixes the "From: " line, so that it shows the sender's email correctly.

2) still need to get the "Subject:" line to correctly show the sender's name
3) and would like to link back to a specific URL on another domain, rather than the domain where the "Tell A Friend" script resides.
    (see reason above in the initial post)

thanx again for any help or advice,
sWitt @ meanpony.com

UPDATE: have hacked my way through to get the results for #2 & #3,
see the above link for results--still working on setting the popup.
will post again when completely implemented.

Quick follow up question-- i'd like to give credit & a link for the
"Tell A Friend" script--any preferences as to whom I should credit & link?
sw
« Last Edit: May 25, 2008, 05:22:51 PM by admin »

Elwood

  • Guest
Re: Customizing "Tell A Friend" script
« Reply #3 on: November 01, 2007, 11:14:59 AM »
maile.php

Code: [Select]
<HTML>
<HEAD>
<CENTER>
<body bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="#669966" alink="#996666">
<font face=" verdana, tahoma" font size="-2">
<?php

if (!$HTTP_POST_VARS["from"] || 
!
$HTTP_POST_VARS["say"]) 

echo 
"Please fill in all fields.";
echo &
#39;<a href="javascript:history.go(-1)">Go Back</a>&#39;; 
exit; 
}
?>

<?php
include(&#39;config.php&#39;);


$time date ("h:i A"); 
$date date ("l, F jS, Y");
$urlh getenv(HTTP_HOST);
$url "http://$urlh";
$IP $_SERVER[&#39;REMOTE_ADDR&#39;];
$to $_POST[&#39;to&#39;]; 
$subject $_POST[&#39;subject&#39;];
$say $_POST[&#39;say&#39;];
$from $_POST[&#39;from&#39;];
$msg $_POST[&#39;msg&#39;];
$zigi $_POST[&#39;zigi&#39;];



$headers  = &#39;MIME-Version: 1.0&#39; . "\r\n";
$headers .= &#39;Content-type: text/html; charset=iso-8859-1&#39; . "\r\n";
$headers .= "From: $say"\r\n";
$bodys .= ("
Take a minute and check out this website that I think you
will enjoy. <strong><a href=
$url>$site</a></strong>,    
<a href=mailto:
$say>Reply to a Message</a>.<br>
<strong><a href=
$urla>$sitea</a>
<strong><a href=
$urlb>$siteb</a>
<strong><a href=
$urlc>$sitec</a>
<hr>
"
);
$bodys .= "$msg <br>";
$bodys .= "<li>Hi, $from,</b> <br>";
$bodys .= "<li>This message was submitted from $zigi$say<br>";
$bodys .= "<li>Sender IP Address: $IP <br>";
$bodys .= "<li>$date$time <br>";
$bodys .= "$mailbody";

$subject .="Message from $zigi";
etc............

in config.php


Code: [Select]
$urla = "http://myurl1.com";
$urlb = "http://myurl2.com";
$urlc = "http://myurl3.com";
$sitea = 'mytextlink1';
$siteb = 'mytextlink2';
$sitec = 'mytextlink3';
etc..............
« Last Edit: May 25, 2008, 05:25:10 PM by admin »

Offline admin

  • Administrator
  • *****
  • Posts: 68
  • Karma: +11/-0
  • Gender: Male
"Tell A Friend" PHP script with captcha
« Reply #4 on: November 19, 2007, 01:22:23 PM »
Captcha by - http://www.webtoolbag.com/captcha-zdr-powerfull-captcha-tool--r70.htm

config.php

Code: [Select]
$site = 'Website Name';
$email = 'admin@example.com';
$powered = 'mywebname.tt';
$title = 'Tell A Friend - Free PHP Script';
$urla = "http://myurl.com";
$urlb = "http://myurl.com";
$urlc = "http://myurl.com";
$sitea = 'link1';
$siteb = 'link2';
$sitec = 'link3';
#################################
# text and images from images dir
#################################
$mailbody = '<img src="http://LINK TO IMAGE"</a><br>TEXT LINE1<br>
TEXT LINE2<br>TEXT LINE3';
#############################
# font type size  background
#############################
$body ='
<html>
<head>

<style>
<!--
body, P.msoNormal, LI.msoNormal
{

background-position: top;
background-color: #336699;
margin-left:  2em;
margin-top: 0em;
margin-bottom: 4em;
font-family: "verdana";
font-size:   7pt;
font-weight: ;
color:    "000000";



}
-->

</style>

</head>
</body>
';
#############################
# DO NOT EDIT BELOW THIS LINE
#############################
$urlz = getenv(HTTP_HOST);
$siteurl = "http://$urlz";


Demo:

http://phpform.net/tella
Download:
Members:
« Last Edit: October 26, 2015, 08:53:37 AM by alex »

Offline leeuniverse

  • Supporter
  • **
  • Posts: 2
  • Karma: +0/-0
Re: Customizing "Tell A Friend" script
« Reply #5 on: February 12, 2008, 02:39:09 AM »
A fix and a recommendation/question.

1. The "_" (underscore) in an email address is not recognized as a valid email address on the form.  Is needed for a lot of people.

2. Can the Form also show the "referral page" link, as well as that link actually being the Link to the website that shows in the emails, instead of simply a link to the website itself?  That way we can refer actual pages of a website, and not just the website itself.
Or at least make it an "option" in the code, i.e. for the referral link to be either the site itself, or the page that we came from to get too the referral Form.  Also, in that vain, make it so only links from "within" the site are referred, not outside, to further help stop bots.  Like, they can't get to the referral form unless it's through the site and clicking a linked page or whatever.

Thanks.....  Seems to be working fine otherwise?   :-X
« Last Edit: May 25, 2008, 05:31:38 PM by admin »

Offline leeuniverse

  • Supporter
  • **
  • Posts: 2
  • Karma: +0/-0
Re: Customizing "Tell A Friend" script
« Reply #6 on: February 15, 2008, 08:45:48 PM »
Also, you might want to make sure the "." (period) will work in an email name.
Cause some people have that also in their email.

By the way....  I think yours is the ONLY free "Tell a Friend" script that has Image Verification.
I haven't been able to find another one anyway.

If you could update this, it would be greatly appreciated.   ;D
« Last Edit: May 25, 2008, 05:32:58 PM by admin »

waickw

  • Guest
Re: Customizing "Tell A Friend" script
« Reply #7 on: May 22, 2008, 01:22:29 AM »
how can i add the other friend ?
in same times forward to 3 friend?
thank

Offline gom3

  • Supporter
  • **
  • Posts: 1
  • Karma: +0/-0
Re: Customizing "Tell A Friend" script
« Reply #8 on: December 08, 2008, 02:45:02 PM »
Ssory. I've traslated this script to russian. And there is trouble with coding. How to set default charset windows1251?

Offline alex

  • Global Moderator
  • *****
  • Posts: 77
  • Karma: +20/-0
Re: Customizing "Tell A Friend" script
« Reply #9 on: December 08, 2008, 05:24:29 PM »
Open maile.php and search for:
Code: [Select]
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
Delete this row and replace it with:
Code: [Select]
$headers .= 'Content-type: text/html; charset=windows1251' . "\r\n";
In the same file search for:
Code: [Select]

<HEAD>
<CENTAR>
Delete this rows and replace it with:
Code: [Select]
<HEAD>
<meta http-equiv="content-type" content="text/html; charset=windows1251">
<CENTER>
new index.php
Code: [Select]
<head>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="content-type" content="text/html; charset=windows1251">
<meta name="title" content="PHP Form.net">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="#669966" alink="#996666">
<font face=" verdana, tahoma" font size="4">
<?php
include(&#39;config.php&#39;);
?>

<title><?php echo $title?></title>
<center>


<h2><?php echo $title?></h2>



<body>
<form name="myform" action="maile.php" method="POST">

<strong>Friends E-mail</strong><br/>
        <input type=text style="font-size: 10px; font-family: tahoma,arial; font-weight: bold; color: #336699; BORDER: #000000 1px line ; BACKGROUND-COLOR: #F8F8F8" name="to" size="25"><br>
<strong>Friends Name</strong><br/>
        <input type=text style="font-size: 10px; font-family: tahoma,arial; font-weight: bold; color: #336699; BORDER: #000000 1px line ; BACKGROUND-COLOR: #F8F8F8" name="from" size="25"><br>
<strong>Your E-mail</strong><br/>
        <input type=text style="font-size: 10px; font-family: tahoma,arial; font-weight: bold; color: #336699; BORDER: #000000 1px line ; BACKGROUND-COLOR: #F8F8F8" name="say" size="25"><br>
        <strong>Your Name</strong><br/>
        <input type=text style="font-size: 10px; font-family: tahoma,arial; font-weight: bold; color: #336699; BORDER: #000000 1px line ; BACKGROUND-COLOR: #F8F8F8" name="zigi" size="25"><br>
    <strong>Your Message</strong><br/>
<input type=text style="font-size: 11px; font-family: tahoma,arial; font-weight: bold; color: #336699; BORDER: #000000 1px line ; BACKGROUND-COLOR: #F8F8F8" name="msg" size="25"><br>
        <input type="hidden" name="image">
        <name="text">
<table width="200" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="200" height="100"  style="border: 1px solid #666666;"><img src="captcha_img.php" border="0"></td>
  </tr>
  <tr>
    <td style="padding-top: 5px" style="font-size: 12px;font-family: arial, verdana, ms sans serif;">   
      Result from image: <input type="text" name="capt" style="width: 80px">
      <div style="padding-top: 5px">
<INPUT TYPE="SUBMIT" VALUE=" Submit"
STYLE="font-family:verdana;
font-size:12px; font-weight:bold; font-style:none; border-style:solid;
 border-color:#0C0D0C; border-width:1px; background:#3AC23A; color:#FFFFFF; width:8em">
<INPUT TYPE="RESET" VALUE=" Reset"
STYLE="font-family:verdana;
font-size:12px; font-weight:bold; font-style:none; border-style:solid;
border-color:#0C0D0C; border-width:1px; background:#3AC23A; color:#FFFFFF; width:8em"></div>
</td>
  </tr>
</table>
</form>
</div>
</div>


</body>
<center>
<font face=" verdana, tahoma" font size="-2"><b>

copyright <a target='_BLANK' href=<?php echo $siteurl?>><?php echo $powered?></a><br>
</b>
</font>
</center>
</html>



Offline 123funda

  • Supporter
  • **
  • Posts: 1
  • Karma: +0/-0
Re: Customizing "Tell A Friend" script
« Reply #10 on: January 17, 2009, 01:10:35 PM »
what we do i f some on server dont suppory webmail function my website http://www.urduworld.110mb.com is hosted in 110mb as  free what i do is there is any other scrip

Offline coin

  • Supporter
  • **
  • Posts: 4
  • Karma: +0/-0
Re: Customizing "Tell A Friend" script
« Reply #11 on: April 21, 2010, 12:19:36 AM »
cool, thanks  :)

Offline vaq

  • Supporter
  • **
  • Posts: 1
  • Karma: +0/-0
Re: Customizing "Tell A Friend" script
« Reply #12 on: December 06, 2010, 05:20:35 AM »
I need to run the script on PHP5. Could it be done?

I get "Deprecated: Function ereg() is deprecated" error

I will check back soon!

Thanks for the script! It so bad it isn't working

Offline ciko

  • Contributor
  • *****
  • Posts: 37
  • Karma: +3/-0
  • Gender: Male
    • phpenter.net
Re: Customizing "Tell A Friend" script
« Reply #13 on: December 06, 2010, 06:45:47 AM »
I get "Deprecated: Function ereg() is deprecated" error

The PHP language developers have decided the PERL/preg functions are superior, so the PHP ereg() family is being deprecated in PHP 5.3, and removed in PHP 6.0.

Offline ciko

  • Contributor
  • *****
  • Posts: 37
  • Karma: +3/-0
  • Gender: Male
    • phpenter.net
Re: Customizing "Tell A Friend" script
« Reply #14 on: December 06, 2010, 07:00:57 AM »
Quote
ereg('pattern', 'string');

becomes:

Quote
preg_match('/pattern/', 'string');


Code: [Select]
if (preg_match("/^\./",$name)) {
echo "<center>Invalid Characters:<a href=\"javascript:history.go(-1)\">Go Back</a></center>"; 
 Die();
}
if (preg_match("/^\</", $name)) {
echo "<center>Invalid Characters: <font color = \"red\"><strong><</strong></font> <a href=\"javascript:history.go(-1)\">Go Back</a></center>"; 
 Die();
}
if (preg_match("/^\[/", $name)) {
echo "<center>Invalid Characters: <font color = \"red\"><strong>[</strong></font> <a href=\"javascript:history.go(-1)\">Go Back</a></center>"; 
 Die();
}
}
function CheckMail($to)
{
if (preg_match("/^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\.[a-z]{2,4}$/",$to))
    {
        return true;
    }
    else
    {   
        return false;
    }
}
if ((empty($to)) || (!CheckMail($to)))
{
 echo "<center>Incorrect Field Friend Email Adress:<a href=\"javascript:history.go(-1)\">Go Back</a></center>"; 
 Die();
}
if (empty($from))
{
 echo "<center>Empty Field: Friend Name:<a href=\"javascript:history.go(-1)\">Go Back</a></center>"; 
 Die();
}


 :) ;)