View Full Version : send to friend script
Does anyone know where I can get a send to friend script that lets you choose of your msn contacts from who to choose and also entering email address manually? please and thank you!
Anyone please, I have tried searching and all that, but they did not seem to work for me! Thank you!!
Master_script_maker
01-03-2008, 09:09 PM
try here (http://www.dynamicdrive.com/forums/showthread.php?t=21972&highlight=friend)
I tried that, however I got to black page when I tested it.
thetestingsite
01-04-2008, 11:38 PM
What is the code that you are using? If you post it, we can see what is wrong with it.
<?php
$domain = "http://www.hetbestevoordeel.be";
$subject = "a friend recommends you this site";
$to = $_POST['to'];
$page = $_POST['url'];
$from = "From: hetbestevoordeel.be <bruno@hetbestevoordeel.be>";
$message = "Hey, I just found an amazing site. Check it out ! ";
$message .= $domain.$page;
mail($to, $subject, $message, $from);
header('Location: '.$domain.page); //redirect to the page they were on.
?><<<<<That's located in "tellafriend.php"
"<form action="tellafriend.php" method="POST">
<input type="hidden" name="url" value="<?php echo $_SERVER['PHP_SELF'];?>">
Email to send to: <input type="text" name="to"> <input type="submit" value="Send">
</form>" <<<<<That's located in my normal pages
thetestingsite
01-06-2008, 03:04 PM
You need to change this line to point to your website:
<?php
$domain = "http://www.hetbestevoordeel.be";
Hope this helps.
Now I get, "The website cannot display the page" when I enter an email address and takes me to "tellafriend.php"
thetestingsite
01-06-2008, 07:17 PM
Did you name the file in the above posts tellafriend.php ?
thetestingsite
01-06-2008, 07:20 PM
Can you post a link to the problem page so that I can see what it is doing.
http://www.athletes4excellence.com/layout.php ; it's on the bottom of the page.
thetestingsite
01-06-2008, 11:10 PM
I completely overlooked this, but on this line there needs to be a dollar sign ($):
header('Location: '.$domain.$page); //redirect to the page they were on.
Hope this helps.
Ok, well now I used it, and it just sort of refreshed the page after I clicked "Send". And when I checked my email address, there was no email.
thetestingsite
01-07-2008, 12:08 AM
Well, the code seems to be correct as if you go to tellafriend.php, it redirects you to the main page; same as if you submit the form on layout.php. The only thing I can think of is a server misconfiguration.
Hope this helps.
What do you mean my misconfiguration? Also, since this one is not working, do you know of any others that have multiple email address to send to and having to have to fill out your name, your email address and also a personal message on top of the regular message...Thanks!
Hello? Please and thank you!
Please help and thank you!
Master_script_maker
01-19-2008, 01:34 PM
look at requirements http://us2.php.net/manual/en/ref.mail.php
I'm getting confused. Why do I need that and how do I apply it? Please and thank you!
djr33
01-19-2008, 08:06 PM
That's the manual for the mail() function. That's how you SEND EMAILS with PHP.
ahh, so what do I do now. Do I apply it to my php code of the email sender? Also if yes, what is the code to put. I am really sorry if this is bothering everyone.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.