Welcome to the Geeks & God Static Archive. Read more »
140 replies [Last post]
Joined: 11/28/2008
Thanks jehoshua - I have

Thanks jehoshua - I have corrected this!

Paul Davey
Whitford Church
"Everyone who calls on the name of the Lord will be saved." Romans 10:13
"For all have sinned and fall short of the glory of God, and are justified

Joined: 11/28/2008
The links dont work for me,

The links dont work for me, 404 errors on both versions, can someone send me them by email to: graphicdesigns@gmail.com

Also, you need to update the topic link on http://www.christian-web-masters.com/artic...ll-scripts.html

change - http://www.christian-web-masters.com/forum...topic.php?t=182
to - http://www.christian-web-masters.com/forum...p?showtopic=182

Andy

Joined: 11/28/2008
I'll use it for some of my

I'll use it for some of my projects, this is a good cript, I'd say!

Joined: 11/28/2008
The download links are still

The download links are still not working for me, can anyone help me?

Andy

Joined: 11/28/2008
Thanks for the corrections

Thanks for the corrections Andy. I have fixed up the forum link, and adjusted the config file so the downloads work. It could happen again - I have fixed it before /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

Paul Davey
Whitford Church
"Everyone who calls on the name of the Lord will be saved." Romans 10:13
"For all have sinned and fall short of the glory of God, and are justified

Joined: 11/28/2008
Thankyou for fixing the

Thankyou for fixing the links!

This script will be very useful on my site!

Andy

Joined: 11/28/2008
Hello,Very nice of you to

Hello,

Very nice of you to support this script, it took me quite a while to find a 'tell a friend' script that worked with register_globals turned off.

Anyway, I have it mostly working however I am having a problem with the $link var. It incorrectly displays the url that is one directory level up from the page that submits the request. For example if I send the mail from http://www.example.com/product/someproduct.php in the email the link will display as http://www.example.com/product/index.html

The tell a friend script is within a server side include and it displays itself properly on all product pages but I really don't know how to troubleshoot the link problem.

Also the error checking doesn't seem to work at all. If I submit the form with all the fields blank the form simply disappears=(

Any help would be greatly appreciated and thanks again for a spiffy script.

-darrick.

Joined: 11/28/2008
Hi everyone I am new to this

Hi everyone I am new to this forum,

I have been reading this thread with imense interest.

I should start out by saying I am very new to web design, but having seen how helpful everyone is in this forum though I would brave asking for some help!

I have been trying to implement a Tell a Friend PHP thread which I found offered here:

Free Tell a riend Script

I have carried out the implementation to the letter but have had only limited success.

Here's what I got to work:

- The pop up tell a friend email form successfully launches in a window;
- after completing the form and click send the window goes through to a thank you page;
- a notfication email is sent to me to say that someone has used the tella friend application.

Here's what doesnt work:

- the tell a friend email is not sent;
- the notification email that I receive doesnt record the sender and recipient's email address as it is supposed to do.

Other people tell me they ahve successfully implemented the script, so there must be something I am missing. I have been careful to implement to the letter making changes only where directed.

As I am a total newbie, are there things about PHP that I am missing. Are there settings I need to make that perhaps I am unaware of. I have checked with my web site host to ensure that PHP is implemented and runnign OK and that has been confirmed as OK.

Any help very much appreciated.
Regards
Peter

Joined: 11/28/2008
Welcome Darrick: It could be

Welcome Darrick: It could be that it is working but it's operation is not intuitive to you. Without a link to your web site, I can't be sure. Basically, it is designed to work so that you visit a certain page, click a link to visit the "Tell A Friend" page (the previous page's address is inserted into the form), and then when the form is submitted that address is inserted into the email.

Welcome Peter (pete917): It is likely that you have register_globals turned off - from looking at the script you linked to, it seems to rely on register_globals being on, which isn't good. register_globals is a configuration setting of PHP. It is widely recommended to have it turned off, though originally it was on by default.

Paul Davey
Whitford Church
"Everyone who calls on the name of the Lord will be saved." Romans 10:13
"For all have sinned and fall short of the glory of God, and are justified

Joined: 11/28/2008
hi bobby mac;Thank you for

hi bobby mac;

Thank you for your help.

As a newbie can you tell me what register globals is and why it is bad to have it switched on versus off?

In the event that I decide to go ahead with it, can you tell me how I switch it on?

Many thanks in advance
Peter

Joined: 11/28/2008
This is a good place to

This is a good place to start: http://php.net/register_globals

Basically, when it is on, scripts are more vulnerable, unless all variables are initialised (given an initial value). It can make it quicker and easier to program, but much easier to have problems too (such as your form being hijacked to send emails to other people). But it depends on the script.

if your script is called like this:

http://www.website.com/script.php?var1=Mike

then with register_globals on, a variable $var1 is automatically created with the value 'Mike'. This seems handy at first, but is potentially dangerous.

I would recommend using the script referenced in this thread.

Paul Davey
Whitford Church
"Everyone who calls on the name of the Lord will be saved." Romans 10:13
"For all have sinned and fall short of the glory of God, and are justified

Joined: 11/28/2008
thank you for that. Do you

thank you for that. Do you have a website that has implement the script in this thread so I can see what it looks like.
Many thanks
Peter

Joined: 11/28/2008
Hi! Thanks...I did a site for

Hi! Thanks...I did a site for my Church's anniversary and my Pastor insisted he wanted an e-invite on it so members can invite their friends electrronically. I scurred the net for codes till I stunbled on your stuff. It really helped me but I still need some help urgently. This is the site www.enlarge2006.com and you can access the main file here: http://www.enlarge2006.com/invite.php My problem(s) are two fold. #1. I want to be able have the referal back message inside my main page rather than on top as it presently appears. #2. I want to be able to send stuff like an e-zine containing graphics rather than plain text.

I tried achieving this by putting my html file (containing the graphics) in the space that was supposed to contain the plain text message, but this kept return an error on lime 63. Could you help me, I need this urgently?

Joined: 11/28/2008
} And make it:$link =

}

And make it:
$link = "http://www.yourWebAddress.com" ;

Let me know how it works.

/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />
[/quote]
How can I make this appear within my page rather than on top like it does prsently? I want to be able to add custom message to it aswell.

Joined: 11/28/2008
I am not sure I understand.

I am not sure I understand. I actually have never used the script, just try to help maintain it. But if you look through this thread there are many people who have used it, none more so than Teresa

Paul Davey
Whitford Church
"Everyone who calls on the name of the Lord will be saved." Romans 10:13
"For all have sinned and fall short of the glory of God, and are justified

Joined: 11/28/2008
hello sean et al -- thank you

hello sean et al -- thank you for a great script and a supportive forum.

i'm a php newbie. i can fumble around the code but with no finesse whatsoever. i'd like to add a function to this script so that there is a hard-coded message, and also a space for the user to include an optional message. basically, i dont want the user to be able to remove my intended message. i tried adding a second text area with the "readonly" attribute but no luck. any ideas?

kathe

Joined: 11/28/2008
The easiest way would be to

The easiest way would be to just append or prepend your message to the message entered by the visitor, in the PHP code.

Something like:

CODE
$mymessage = 'Hi how are you my name is Fred
================================
';

$message1 = $_POST['friend_name1'] . "\r\n" . $mymessage . $_POST['message'];

$message2 = $_POST['friend_name2'] . "\r\n" . $mymessage . $_POST['message'];

$message3 = $_POST['friend_name3'] . "\r\n" . $mymessage . $_POST['message'];

(so for each one)

Paul Davey
Whitford Church
"Everyone who calls on the name of the Lord will be saved." Romans 10:13
"For all have sinned and fall short of the glory of God, and are justified

Joined: 11/28/2008
Hello SeanThanks a lot for

Hello Sean

Thanks a lot for updating the tell a friend script. I am attempting to use the script that requires the phpmailer from SourceForge but am having a major problem that I can't figure out.

I have added the form to my site and have tested sending the link to one of my e-mail addresses and although the notification works, I haven't received the e-mail recommendation in my inbox. I am wondering if it might be because I have to authenticate the SMTP because it hasn't been working with the $mail->Host = "localhost" bit. Another e-mail form that I use which requires the SMTP mailer has the following code (of course with the right information in it.)

$mail->Host = ""; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = ""; // SMTP username
$mail->Password = ""; // SMTP password

Do I have to add something like this to the tellafriend script you've created? if so, how?
Any help you can give would be super appreciated.

Thanks a lot
Nekeisha

QUOTE(Sean Buscay @ Mar 3 2003, 10:50 AM)
This topic is to discuss and get help for the free PHP Tell-A-Friend script found here.

http://www.christian-web-masters.com/artic...ll-scripts.html

Blessings:
Sean

Script has been updated in response to abuse by spammers (17th Feb 2006)
Please download the updated version(s) if you are using this script, or you may have trouble from your web host

Hello Sean

Thanks a lot for updating the tell a friend script. I am attempting to use the script that requires the phpmailer from SourceForge but am having a major problem that I can't figure out.

I have added the form to my site and have tested sending the link to one of my e-mail addresses and although the notification works, I haven't received the e-mail recommendation in my inbox. I am wondering if it might be because I have to authenticate the SMTP because it hasn't been working with the $mail->Host = "localhost" bit. Another e-mail form that I use which requires the SMTP mailer has the following code (of course with the right information in it.)

$mail->Host = ""; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = ""; // SMTP username
$mail->Password = ""; // SMTP password

Do I have to add something like this to the tellafriend script you've created? if so, how?
Any help you can give would be super appreciated.

Thanks a lot
Nekeisha

Joined: 11/28/2008
Hi NekeishaI have not used

Hi Nekeisha

I have not used the SMTP mailer, so I don't know much about it. What you posted makes sense to me, by defining the username and password. I would find the line

CODE
$mail->Host = "localhost";

and add these after it (with correct values):

CODE
$mail->Username = ""; // SMTP username
$mail->Password = ""; // SMTP password

Paul Davey
Whitford Church
"Everyone who calls on the name of the Lord will be saved." Romans 10:13
"For all have sinned and fall short of the glory of God, and are justified

Joined: 11/28/2008
Hi again BobbyMacI tried your

Hi again BobbyMac

I tried your suggestion above: putting the username and password information under the localhost command however that didn't work either. Perhaps it might help to know the error message I am getting?

As I mentioned, the notification e-mail is sent but the person who is supposed to receive the invitation to visit the site does not get the e-mail. The person filling out the tell a friend form gets a message like this sent to them, telling the the e-mail didn't go through:

QUOTE
The original message was received at Sat, 3 Mar 2007 20:52:03 -0800 (PST)
from localhost [127.0.0.1]

----- The following addresses had permanent fatal errors -----
<RECIPEIENT@EMAIL.com>
(reason: 554 sorry, sender mail address must correspond local mail domain
(#5.7.1))

----- Transcript of session follows -----
... while talking to mail1.HOSTING-COMPANY-DOMAIN.com.:
>>> RCPT To:<RECIPEIENT@EMAIL.com>
<<< 554 sorry, sender mail address must correspond local mail domain (#5.7.1)
554 5.0.0 Service unavailable
451 4.4.1 reply: read error from mail1.HOSTING-COMPANY-DOMAIN.com.
<webmaster@DOMAIN.com>... Deferred: Connection reset by
mail1.HOSTING-COMPANY-DOMAIN.com.
Final-Recipient: RFC822; RECIPEIENT@EMAIL.com
Action: failed
Status: 5.0.0
Remote-MTA: DNS; mail1.SITEHOST.com
Diagnostic-Code: SMTP; 554 sorry, sender mail address must correspond local mail
domain (#5.7.1)
Last-Attempt-Date: Sat, 3 Mar 2007 20:52:03 -0800 (PST)

EMAIL MESSAGE INCLUDED AFTERWARDS

I've tried everything I can think of to figure out what the problem is. Any help you can give would be much appreciated.

Thanks for looking at this again
Nekeisha

Joined: 11/28/2008
Do you define a "From" email

Do you define a "From" email address anywhere? It needs to be an email account on the server - the hosts do this to stop it being used for spam.

Paul Davey
Whitford Church
"Everyone who calls on the name of the Lord will be saved." Romans 10:13
"For all have sinned and fall short of the glory of God, and are justified

Joined: 11/28/2008
post moved to new topic

post moved to new topic

Joined: 11/28/2008
Hi,I have used the script on

Hi,

I have used the script on my website http://www.aviationearth.com
The mails are never sent.

Please help me

Thanks


Joined: 11/28/2008
Can you explain a little

Can you explain a little more? You're going to have to provide more information for people to be able to help you.

CWM Post with Helpful Links for Web Design Newbies<

Joined: 11/28/2008
I tested the form on Aircraft

I tested the form on Aircraft Rawk's site. It looks good, but when I clicked "Submit", it gave an error message:

Mail could not be sent to (my address) Please use your back button to try them again.

Of course, that's the standard error message when the "mail" command doesn't complete. (I didn't enter anything that could be considered spam, in fact, didn't add any personal message at all, so that isn't the problem.)

He does have his website address entered correctly, because it shows up in the default message:

You have been invited to visit:
http://www.aviationearth.com/index.html

I'm not sure who the host is. Do they allow PHP @mail?

I'm not a PHP expert, but it appears that something is going wrong on this line (approximately line 262):

CODE
    if (@mail($mailto, $subject, $message, $headers)) {

When that fails, it defaults to the error message mentioned above (Mail could not be sent...) ... but I don't know why it's failing.

Maybe that will help someone else know what to look for.

God bless,
Teresa /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

Joined: 11/28/2008
Teresa @ Mar 10 2008,
QUOTE(Teresa @ Mar 10 2008, 01:38 AM)
I tested the form on Aircraft Rawk's site. It looks good, but when I clicked "Submit", it gave an error message:

Mail could not be sent to (my address) Please use your back button to try them again.

Of course, that's the standard error message when the "mail" command doesn't complete. (I didn't enter anything that could be considered spam, in fact, didn't add any personal message at all, so that isn't the problem.)

He does have his website address entered correctly, because it shows up in the default message:

You have been invited to visit:
http://www.aviationearth.com/index.html

I'm not sure who the host is. Do they allow PHP @mail?

I'm not a PHP expert, but it appears that something is going wrong on this line (approximately line 262):

CODE
    if (@mail($mailto, $subject, $message, $headers)) {

When that fails, it defaults to the error message mentioned above (Mail could not be sent...) ... but I don't know why it's failing.

Maybe that will help someone else know what to look for.

God bless,
Teresa /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

Thanks for checking it out.

My host(yahoo) does allow PHP

Please tell me what must be done

Thank You


Joined: 11/28/2008
Are you able to send an email

Are you able to send an email using a basic call to the mail function?

Paul Davey
Whitford Church
"Everyone who calls on the name of the Lord will be saved." Romans 10:13
"For all have sinned and fall short of the glory of God, and are justified

Joined: 11/28/2008
Aircraft,

Aircraft,

http://www.aviationearth.com/recform.php

The link in your menu takes me to the above page, which is not a complete webpage, you have only set up the HTML form part of the script there. The script is intended to be entered within a webpage, or called up as an include. I don't see in the code for the above page how you are calling up the script. Did you follow the instructions at the top of the script file?

CODE
//Copy and paste this code into your PHP page, where you want
//the Tell a Friend Form to appear.
//Note if you do not know PHP, just make a regular HTML page
//and save it as a .php file.  

//You can also save this as a .php file such as "tell.php"
//and include it in the php file(s) of your choice
//using: include("tell.php");

Here is a page that explains php includes:
http://www.tizag.com/phpT/include.php

CWM Post with Helpful Links for Web Design Newbies<

Joined: 11/28/2008
Hi,Is is possible for anyone

Hi,

Is is possible for anyone to give me step-by-step instructions as i have no past experience......i am just 14 /guitar.gif" style="vertical-align:middle" emoid=":guitar:" border="0" alt="guitar.gif" />

Thanks in advance


Joined: 11/28/2008
WeBBy,It appears that

WeBBy,

It appears that Aircraft has set up the page using the first option (not the "include" option):

CODE
//Note if you do not know PHP, just make a regular HTML page
//and save it as a .php file. "

His home page has the following code:

CODE
<a href="recform.php" target="_blank">Tell A Friend About This Page </a>

When clicked that brings up the form.

Yes, the Tell-A-Friend form would ideally be inserted as the content of a regular page on the site. I assumed that he was testing it first ... then adding the rest of the page (header, menu, etc.). It should certainly work by itself.

When you "view source" his code does show only the form. Isn't PHP code hidden when you "view source"? When I "view source" on my Tell-A-Friend page (myavpc.com/tell.php), all it shows in that section is the form (no PHP script) - just like Aircraft's page.

He has loaded the PHP script because when you try to send a mail it displays the "Mail could not be sent to (email address entered) ..." error message from the script.

------------------------------------------------------------------

Aircraft,

To answer BobbyMac's question, try this script in a new page:

CODE
<?php

$mailto = 'yourname@yoursite.com;
$subject = 'Testing mail';
$message = 'Testing mail function on this server';

if (@mail($mailto, $subject, $message)) {
    echo ('<p>Your message was successfully sent to ' . $mailto . '</p>');
    }
    else {
                echo('<p>Mail could not be sent.</p>');
             };
        
?>

CHANGE "yourname@yoursite.com" to YOUR email address. Save the file and name it something like "mailtest.php"

Then go to that page in a browser and let us know which message you get.

God bless,
Teresa /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

Joined: 11/28/2008
Teresa, yes, you're right, I

Teresa, yes, you're right, I wrote that on the way out of town and was too quick. PHP does not appear in the source. However, the form would make sense to me better within a standing page, rather than showing up from a link in the menu. Sooner or later the people using it must get back to the site. The notes indicate to put the script within the page, and I don't think he's done that.

Aircraft, why don't you copy and paste the script you've set up here so people can see what you've done it? Be sure to use a dummy email address so the real one won't be on display here in the code.

CWM Post with Helpful Links for Web Design Newbies<

Joined: 11/28/2008
CODE Your message was
CODE
Your message was successfully sent to ' . $mailto . '

'); } else { echo('

Mail could not be sent.
'); }; ?>

Thanks for the help everyone, much appreciated.

Teresa after putting your code i got the above message.

What next?

Thanks again


Joined: 11/28/2008
Aircraft, it looks as if the

Aircraft, it looks as if the script has not been configured properly. You need to show what you did *before* the script is processed not after.

Please copy the script as you have configured it, EXCEPT change your email address to a dummy address. I mean by that, user@domain.com

Copy the entire script, okay?

CWM Post with Helpful Links for Web Design Newbies<

Joined: 11/28/2008
The code i inserted at the

The code i inserted at the tell-a-form page is:

<?php
//PHP Script: Tell A Friend : Copyright Christian-web-masters.com
//You can get free and friendly help with this script at the
//Christian Web Masters forums: www.christian-web-masters.com/forums

//Copy and paste this code into your PHP page, where you want
//the Tell a Friend Form to appear.
//Note if you do not know PHP, just make a regular HTML page
//and save it as a .php file.

//You can also save this as a .php file such as "tell.php"
//and include it in the php file(s) of your choice
//using: include("tell.php");

//Then just link to this page from wherever you want.

//You will need to configure the script.
//It's easy, just use a text editor.
//Follow the instructions in the "Begin Configure" section below.

//Note: This script contains a link to our site.
//We'd like it if you left it, but you have permission to remove it. /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

//This script uses the new $_POST and $_SERVER['HTTP_REFERRER']
//If you have an issue with an older version of PHP, you can get help at:

// ************Begin Configure***************

//Put your website name between the quotes below:
$websiteName = "Aviation Earth";

//Put your website address between the quotes below:
$websiteAddress = "www.aviationearth.com";

// If you have a privacy policy, put in the link title:
$privacyPolicyLinkText = "";

// Put in the "" the url to you your privacy policy, if you have one,
$privacyPolicyLinkURL = "";

// Change the 0 to a 1 below,
//if you want to recieve a notice when people are refered:
$notice = 1;

//Put your email address in the " " if you changed the notice to 1
$adminEmail = "xyz@xyz.com";

//Put the subject line text you want the email to read in the "":
$subject = "Web Page Recommendation";

// Put your default message intro text in the first set of quotes below
//This is what the people who are referred will see
//along with any personal message entered by the referer.
$defaultMessageIntro = "You have been invited to visit: " . "\n" ;

//Put in the "" your default close (this will be at the end of the message):
$defaultMessageClose = "Aviation Earth is the Growing Aviation Database with Aons of Aircraft Information You can visit MySiteName at: http://www.aviationearth.com";

// ************End Configure****************

// Set the link that will be in intro/invite and used to send the referer back
if (isset($_POST['link'])) {
$link = $_POST['link'];
}
else {
if (empty($_SERVER['HTTP_REFERER'])) {
$link = 'http://' . $websiteAddress;
} else {
$link = $_SERVER['HTTP_REFERER'];

}
}
// Add the link to the intro
$defaultMessageIntro = $defaultMessageIntro . $link . "\n";

//Adds a space infront of the subject line (to add a name latter
$subject = ' ' . $subject;
?>
<?php
function doTellForm ($privacyPolicyLinkText, $privacyPolicyLinkURL, $defaultMessageIntro, $link)
{
// If you understand HTML, you can make changes to the form layout below.
// I just copy the HTML from the "<form" opening to the "</form>"
// Put it into Dreamweaver (WYSIWYG Editor), work on it and put it back.
$theForm = <<<EOD
<form name="tellForm" method="post" action="">
<table width="500px" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="50%"><div align="center">Your name:</div></td>
<td width="50%"><div align="center">Your email:</div></td>
</tr>
<tr>
<td> <div align="center">
<input name="your_name" type="text" id="your_name">
</div></td>
<td> <div align="center">
<input name="your_email" type="text" id="your_email">
</div></td>
</tr>
<tr>
<td><div align="center"></div></td>
<td><div align="center"></div></td>
</tr>
<tr>
<td><div align="center">Enter the name(s) of your friend(s):</div></td>
<td><div align="center">Enter the email(s) of your friend(s):</div></td>
</tr>
<tr>
<td> <div align="center">
<input name="friend_name1" type="text" id="friend_name1">
</div></td>
<td width="50%"> <div align="center">
<input name="friend_email1" type="text" id="friend_email1">
</div></td>
</tr>
<tr>
<td> <div align="center">
<input name="friend_name2" type="text" id="friend_name2">
</div></td>
<td> <div align="center">
<input name="friend_email2" type="text" id="friend_email2">
</div></td>
</tr>
<tr>
<td> <div align="center">
<input name="friend_name3" type="text" id="friend_name3">
</div></td>
<td> <div align="center">
<input name="friend_email3" type="text" id="friend_email3">
</div></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<p>Your Message (optional):
<input name="tellsubmit" type="hidden" id="tellsubmit4" value="doTheSend">
<input name="link" type="hidden" id="link" value="$link">
<br>
<textarea name="message" cols="50" rows="5" id="textarea">$defaultMessageIntro</textarea>
</p>
</div></td>
</tr>
<tr>
<td colspan="2"><p align="center">
<input type="submit" name="Submit" value="Send It">
</p>
<p align="center"><a href="$privacyPolicyLinkURL" target="_blank">$privacyPolicyLinkText</a><br>
<a href="http://www.christian-web-masters.com" target="_blank">free php scripts</a></p></td>
</tr>
</table>
<div align="center">
</div>
</form>
EOD;
echo ($theForm);
}
?>
<?php

function spamcheck($array) {
# returns true if data is ok, otherwise false if it is spam-looking
return (!preg_match("/(MIME-Version:|Content-Type:|\n|\r)/i", join('',array_values($array)) ));
}

function myMailFunction($mailto, $subject, $message, $headers, $defaultMessageClose, $adminEmail, $notice) {
$message = $message . "\n\n" . $defaultMessageClose;

// Check for suspected spam content
if (!spamcheck(array($mailto,$subject,$headers))) {
die('no spam please');
}

if (@mail($mailto, $subject, $message, $headers)) {
echo ('<p>Your message was successfully sent to ' . $mailto . '</p>');
if ($notice == 1) {
$message = "From email " . $headers . "\n\n" . "To email " . "\n\n" . $mailto . "\n\n" . $message;
@mail($adminEmail, "Referal notice", $message);
}
}
else {
// This echo's the error message if the email did not send.
// You could change the text in between the <p> tags.
echo('<p>Mail could not be sent to ' . $mailto . ' Please use your back button to try them again.</p>');
}
}
?>
<?php

function doTell ($notice, $adminEmail, $subject, $websiteName, $defaultMessageClose, $link) {
if ($_POST['your_email'] != "") {
$headers = 'From: ' . $_POST['your_name'] . '<' . $_POST['your_email'] . '>';
}
else {
$headers = 'From: ' . $websiteName . '<' . $adminEmail . '>';
}

if ($_POST['friend_email1'] != "") {

$mailto1 = $_POST['friend_email1'];

//This tacs the name onto the subject line
$subject1 = $_POST['friend_name1'] . $subject;
//This tacs the name onto the message
$message1 = $_POST['friend_name1'] . "\r\n" . $_POST['message'];

myMailFunction($mailto1, $subject1, $message1, $headers, $defaultMessageClose, $adminEmail, $notice);
}

if ($_POST['friend_email2'] != "") {

$mailto2 = $_POST['friend_email2'];

//This tacs the name onto the subject line
$subject2 = $_POST['friend_name2'] . $subject;
//This tacs the name onto the message
$message2 = $_POST['friend_name2'] . "\r\n" . $_POST['message'];

myMailFunction($mailto2, $subject2, $message2, $headers, $defaultMessageClose, $adminEmail, $notice);
}
if ($_POST['friend_email3'] != "") {

$mailto3 = $_POST['friend_email3'];

//This tacs the name onto the subject line
$subject3 = $_POST['friend_name3'] . $subject;
//This tacs the name onto the message
$message3 = $_POST['friend_name3'] . "\r\n" . $_POST['message'];

myMailFunction($mailto3, $subject3, $message3, $headers, $defaultMessageClose, $adminEmail, $notice);
}

$return = <<<EOD
<p align="center"><a href="$link">Return to the page you left.</a></p>
EOD;

echo ($return);
}
?>
<?php

if (isset($_POST['tellsubmit'])) {
doTell($notice, $adminEmail, $subject, $websiteName, $defaultMessageClose, $link);
}
else {
doTellForm($privacyPolicyLinkText, $privacyPolicyLinkURL, $defaultMessageIntro, $link);
}
?>

Thanks WeBBy
Sorry for not using the codebox i was getting some error


Joined: 11/28/2008
I just copied the code

I just copied the code Aircraft posted, changed the email address (nothing else), and loaded it on my site. It worked perfectly.

My guess is that you need to talk to your host. They may need to change some permissions, etc.

Teresa /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

Joined: 11/28/2008
Teresa @ Mar 12 2008,
QUOTE(Teresa @ Mar 12 2008, 05:30 AM)
I just copied the code Aircraft posted, changed the email address (nothing else), and loaded it on my site. It worked perfectly.

My guess is that you need to talk to your host. They may need to change some permissions, etc.

Teresa /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

Ohk......will do that immidiately

Thanks


Joined: 11/28/2008
Hi Aircraft,Was wondering

Hi Aircraft,

Was wondering what kind of response you got from the host? Any success there?

Teresa /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

Joined: 11/28/2008
I have downloaded the Version

I have downloaded the Version 1 of the tell-a-friend script and am having trouble getting it to work.

Im sure this is not a problem with the script but a problem with me. I have very little experience in the area and hope that someone can guide me through.

- I have configured the file;
- saved it as tell.php
- I inserted <? include("../tell.php"); ?> on the page I want the form to appear

I have also tried inserting all the tell-a-friend script into a php file. When I upload the file and browse to it, I just get a blank screen......

what do I do next to get the form to appear?

MAny thanks in advance
Peter

Joined: 11/28/2008
Can I start with a very basic

Can I start with a very basic question: do you have use of PHP on your web site? If you do a view-source, do you see PHP code?

Otherwise, it would appear some sort of error has occurred.

Paul Davey
Whitford Church
"Everyone who calls on the name of the Lord will be saved." Romans 10:13
"For all have sinned and fall short of the glory of God, and are justified

Joined: 11/28/2008
bobbymac @ Aug 4 2008,
QUOTE(bobbymac @ Aug 4 2008, 02:54 PM)
Can I start with a very basic question: do you have use of PHP on your web site? If you do a view-source, do you see PHP code?

Otherwise, it would appear some sort of error has occurred.

Thank you.

I have PHP scripts already running on this site.

I cant seem to find an error though.

I just tried pasting the code into a file and saving as a *.php and uploading. When I upload I just get a blank page.

Any thoughts on why?

Also, if I want to save the script as say "tell.php" and then reference it in another file how do I go about that?

MAny thanks in advance