ammar555 Posted April 1, 2010 Share Posted April 1, 2010 I only have one quick question and I hope someone will direct me to the right path. As we all know Facebook is very growing website, and i have noticed something that they use. When someone registers on their website, they ask you to log in to your e-mail and they try to find your friends based on who you have in your list. Now i am want to create something similar to that, but i really don't know how to start? I am not even sure if i need php to do that. When someone registers on my website, I want to let them invite all of their friends by sending them a message automatically so that they could come and register on my website too . How do i start? What is the idea here? Will i need php to do that ? I would love any help! Quote Link to comment https://forums.phpfreaks.com/topic/197276-how-do-i-invite-people-to-my-website-like-facebook/ Share on other sites More sharing options...
2levelsabove Posted April 1, 2010 Share Posted April 1, 2010 What you are looking for is a "PHP invite a friend script" and yes it could be written in PHP. You can ask people for help in the forums to help you write one or you can search for it on the search engines. Good luck! Quote Link to comment https://forums.phpfreaks.com/topic/197276-how-do-i-invite-people-to-my-website-like-facebook/#findComment-1035468 Share on other sites More sharing options...
TeddyKiller Posted April 1, 2010 Share Posted April 1, 2010 You can use API's, which can be gotten by Windows Live, Yahoo, Google mail, and others, or you can simply have a textbox for your users friends email address('s) and use the mail() function to process it. Quote Link to comment https://forums.phpfreaks.com/topic/197276-how-do-i-invite-people-to-my-website-like-facebook/#findComment-1035535 Share on other sites More sharing options...
ammar555 Posted April 2, 2010 Author Share Posted April 2, 2010 What you are looking for is a "PHP invite a friend script" and yes it could be written in PHP. You can ask people for help in the forums to help you write one or you can search for it on the search engines. Good luck! I will google that right now and thanks, if i have something i will come back Quote Link to comment https://forums.phpfreaks.com/topic/197276-how-do-i-invite-people-to-my-website-like-facebook/#findComment-1035607 Share on other sites More sharing options...
ammar555 Posted April 2, 2010 Author Share Posted April 2, 2010 You can use API's, which can be gotten by Windows Live, Yahoo, Google mail, and others, or you can simply have a textbox for your users friends email address('s) and use the mail() function to process it. Is this what you mean? http://msdn.microsoft.com/en-us/library/bb463989.aspx Or is this something else? Do you know where i can get examples ? Quote Link to comment https://forums.phpfreaks.com/topic/197276-how-do-i-invite-people-to-my-website-like-facebook/#findComment-1035609 Share on other sites More sharing options...
TeddyKiller Posted April 2, 2010 Share Posted April 2, 2010 Yes, that can help you. Bare in mind, it's confusing and you need atleast a VPS hosting. (Most shared hostings dont support all the features it needs) Hence why I've just stuck to an invite a friend script in PHP. It's pretty basic and rubbish, but I can post it through if you want? Quote Link to comment https://forums.phpfreaks.com/topic/197276-how-do-i-invite-people-to-my-website-like-facebook/#findComment-1035876 Share on other sites More sharing options...
ammar555 Posted April 2, 2010 Author Share Posted April 2, 2010 Yes, that can help you. Bare in mind, it's confusing and you need atleast a VPS hosting. (Most shared hostings dont support all the features it needs) Hence why I've just stuck to an invite a friend script in PHP. It's pretty basic and rubbish, but I can post it through if you want? Yes please I would love that, at least i will get the idea Quote Link to comment https://forums.phpfreaks.com/topic/197276-how-do-i-invite-people-to-my-website-like-facebook/#findComment-1035986 Share on other sites More sharing options...
TeddyKiller Posted April 2, 2010 Share Posted April 2, 2010 <?php if(isset($_POST['invite'])) { if(empty($_POST['recipent'])) { //Check if the recipent field in the form is empty echo "You have left an empty field!"; } else { $to = $_POST['recipent']; //Recipent field in the form - This is the email the invitation is going to $subject = "SUBJECT HERE."; //Subject $message = "YOUR MESSAGE HERE"; //Message $header = "From: YOUR-NAME <[email]YOUR-EMAIL@EMAIL.COM[/email]> " . "\r\n"; //Set the header of the message $send = mail($to, $subject, $message, $header); //Put it all together and SEND! echo "Your invitations have been sent!"; //It's successful so display a message } } ?> <form action="" method="post"> <span>Type in your friends emails seperated with a comma and click invite!</span><br /> <input type="text" name="recipent" id="recipent" size="50" /> <input type="submit" name="invite" value="Invite!" /> </form> Replace.. "SUBJECT HERE", "YOUR MESSAGE HERE", "YOUR-NAME", "YOUR-EMAIL@EMAIL.COM", with the desired inputs. This should work though. edit: multiple email addresses can be used, if it's seperated. Quote Link to comment https://forums.phpfreaks.com/topic/197276-how-do-i-invite-people-to-my-website-like-facebook/#findComment-1036008 Share on other sites More sharing options...
ammar555 Posted April 2, 2010 Author Share Posted April 2, 2010 <?php if(isset($_POST['invite'])) { if(empty($_POST['recipent'])) { //Check if the recipent field in the form is empty echo "You have left an empty field!"; } else { $to = $_POST['recipent']; //Recipent field in the form - This is the email the invitation is going to $subject = "SUBJECT HERE."; //Subject $message = "YOUR MESSAGE HERE"; //Message $header = "From: YOUR-NAME <[email]YOUR-EMAIL@EMAIL.COM[/email]> " . "\r\n"; //Set the header of the message $send = mail($to, $subject, $message, $header); //Put it all together and SEND! echo "Your invitations have been sent!"; //It's successful so display a message } } ?> <form action="" method="post"> <span>Type in your friends emails seperated with a comma and click invite!</span><br /> <input type="text" name="recipent" id="recipent" size="50" /> <input type="submit" name="invite" value="Invite!" /> </form> Replace.. "SUBJECT HERE", "YOUR MESSAGE HERE", "YOUR-NAME", "YOUR-EMAIL@EMAIL.COM", with the desired inputs. This should work though. edit: multiple email addresses can be used, if it's seperated. It looks great, i will check it out and come back, ("YOUR MESSAGE HERE"), I still have to design the invitation message, and make it look like a website (HTML format). When I am done with the design, Do I copy the code and paste it instead of ("YOUR MESSAGE HERE") Quote Link to comment https://forums.phpfreaks.com/topic/197276-how-do-i-invite-people-to-my-website-like-facebook/#findComment-1036058 Share on other sites More sharing options...
TeddyKiller Posted April 2, 2010 Share Posted April 2, 2010 Has to be done inside the double quotes. Like an echo would be. You'll need to set the header so it allows HTML too. Quote Link to comment https://forums.phpfreaks.com/topic/197276-how-do-i-invite-people-to-my-website-like-facebook/#findComment-1036086 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.