Log in

View Full Version : send to friend script



afe
12-27-2007, 09:16 PM
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!

afe
01-03-2008, 07:48 PM
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)

afe
01-04-2008, 11:04 PM
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.

afe
01-05-2008, 08:48 PM
<?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.

afe
01-06-2008, 06:56 PM
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 ?

afe
01-06-2008, 07:19 PM
Yes, I did.

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.

afe
01-06-2008, 11:04 PM
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.

afe
01-06-2008, 11:51 PM
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.

afe
01-07-2008, 11:33 PM
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!

afe
01-13-2008, 12:40 AM
Hello? Please and thank you!

afe
01-19-2008, 04:47 AM
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

afe
01-19-2008, 07:10 PM
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.

afe
01-19-2008, 08:09 PM
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.