PDA

View Full Version : Help with tell a friend PHP



stenotome
04-16-2006, 09:08 AM
I saw your written tutorial for the tell a friend script. I made the html form. I downloaded the tellafriend.php, phpmailer.php and the smtp.php thru ftp manager. I tested it on my website and come up with the following message:

Message was not sent
Mailer Error: Language string failed to load: recipients_failed

my webpage is www.stenotome.com (http://www.stenotome.com) in case you need to look at it.

Thanks,

Michele

navaldesign
04-16-2006, 10:13 AM
1. My instructions about modifying the script were about VISUAL changes. Not abour renaming the filelds, nor about adding fields. You have done both.
2. You have added also more Hidden fields, other than the ones i have inserted in the script. Why?
3. You have also changed the titles of the hidden fields: changed the lowercase initial letters in Uppercase, and changed the "youremail" in Your email"
4. You have not provided the "youremail" hidden field value in the form. You should provide your real email address there, otherwise the script doesn't know which email account to use in order to send the email to the friend. This, together with changing the hidden field name from "youremail" to "Your Email" is your main problem.

Please redo the job, following EXCACTLY the instructions. Php scripts are very sensitive in changes. If you ghange the form, as you did, you must also schange the script.

stenotome
04-16-2006, 05:45 PM
Sorry, the first time I unzipped this file and opened the Blue Voda tell a friend, I didn't see the box that I see now so I thought I had to make it up myself. I just deleted the zip file and rezipped it to start from scratch and now I opened up the tell a friend BV file and see the box. So now I see what you are saying. I'll can now go through the steps exactly as you have them.

navaldesign
04-16-2006, 05:56 PM
Glad you solved the problem.

stenotome
04-16-2006, 06:01 PM
I guess I spoke too soon.

I did a test email, sending it to my home email at michlegeurts@sbcglobal.net and it came up with this error:

Message was not sent
Mailer Error: Language string failed to load: recipients_failedmichlegeurts@sbcglobal.net

navaldesign
04-16-2006, 07:51 PM
You have mistaken the "youremail" hidden field value: you have put m..@stentome.com instead of stenotome

stenotome
04-16-2006, 08:09 PM
Okay, thanks. Got that part fixed.

When I hit "tell a friend" button, it takes me to unknown page. Can I redirect it back to my home page? And how?

Thank you.

navaldesign
04-16-2006, 08:16 PM
Change the

header("Location: returnpage.html"); // returnpage is the same page of the form or another of your choice.

line of the tellafriend.php script. Replace the "returnpage.html" with the actual page you want the script to go to after submitting the email.

You may also want to change the page name: don't think you want "Navaldesign Tell a Friend Script" to appear as your page name

stenotome
04-16-2006, 08:34 PM
PERFECT!!!

Thank you so much.

The one and only (hopefully last) thing that I want to tweak is the email sent out. I want the sender's name in there somewhere so when people get this referral email, it shows a familiar name in the email somewhere. Maybe they'll be less likely to delete it right away if they see it is truly being referred by a person they know.

navaldesign
04-17-2006, 08:40 AM
After the lines in red
$mail->Body = "Hi $friendname\n"
. "$message\n "

add this line:


. "Bye, $name\n";

Attention: delete the ";" at the end of the second line in red