NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Super-simple "invite a friend" script?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 07-04-2005, 04:10 PM THREAD STARTER               #1 (permalink)
Senior Member
 
Ringr's Avatar
Join Date: Jul 2004
Posts: 1,383
Ringr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to behold
 



Super-simple "invite a friend" script?


Hey guys,

I am just looking for a very simple (no I don't need anything fancy or complex) PHP script or something of the like, where people can click on a link and it will simply go to a page where people can fill in up to 5 email address and press "send" and then an email will be dispatched to those email addresses with a customized message.

Anyone know where I could get one, or maybe one of you has made something like this?
Once again, please keep things simple I don't need a whole darned complex script with ever bell and whistle on it - just a simple little deal like I said above.

Thanks guys,
I hope someone can help me out;
-Andy M.
????: NamePros.com http://www.namepros.com/programming/104086-super-simple-invite-a-friend-script.html



P.S. Please don't say "OMG DID YOU CHECK HOTSCRIPTS?!" gees I hate when people say that. I've looked a lot of places including Hotscripts but haven't found anything yet.
Ringr is offline  
Old 07-04-2005, 04:21 PM   #2 (permalink)
NamePros Member
Join Date: Aug 2004
Posts: 73
Crabby is an unknown quantity at this point
 



OMG DID YOU CHECK HOTSCR... oh, sorry.

I'll write one right here, right now

PHP Code:
<?php
if ( $_SERVER["REQUEST_METHOD"] != "POST" )
{
?>
<h1>Tell a Friend</h1>
<form action="<?= $_SERVER["PHP_SELF"?>" method="post">
<table width="100%">
<tr>
<td>Friend's e-mail:</td>
<td><input type="text" name="friend[]" /></td>
</tr>
<tr>
<td>Friend's e-mail:</td>
<td><input type="text" name="friend[]" /></td>
</tr>
<tr>
<td>Friend's e-mail:</td>
<td><input type="text" name="friend[]" /></td>
</tr>
<tr>
<td>Friend's e-mail:</td>
<td><input type="text" name="friend[]" /></td>
</tr>
<tr>
<td>Friend's e-mail:</td>
<td><input type="text" name="friend[]" /></td>
</tr>
</table>
<br />
<input type="submit" value="Send" />
<?php
}
else
{
$subject "Check this out!"// E-mail subject
ob_start();
?>
Hello,

Check out our site:
http://www.example.com/

Thanks,
Some siteee!
<?php // Put your e-mail message between the php tags.
$message ob_get_contents();
ob_end_clean();
$_POST["friend"] = is_array$_POST["friend"] )? $_POST["friend"] : array();
for( 
$i 0$i count$_POST["friend"] ); $i++ )
{
$friend $_POST["friend"][$i];
????: NamePros.com http://www.namepros.com/showthread.php?t=104086
mail$friend$subject$message"From: Some site <siteemail@example.com>\n" );
}
?>
<h1>Tell a Friend</h1>
Thanks for telling your friends, the e-mails have been sent!
????: NamePros.com http://www.namepros.com/showthread.php?t=104086
<?php
}
?>
Last edited by Crabby; 07-08-2005 at 01:24 AM.
Crabby is offline  
Old 07-04-2005, 04:59 PM THREAD STARTER               #3 (permalink)
Senior Member
 
Ringr's Avatar
Join Date: Jul 2004
Posts: 1,383
Ringr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to behold
 



Everytime I say the thing about Hotscripts, at least one person replies like you did.
Lol

Crabby, thanks a billion for your help. You have no idea how much it helped me.

Thanks!
-Andy M.

---
Edit: I am getting this error:
Code:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/flametid/public_html/sa/invite-a-friend.php on line 49
Line 49 is this: foreach( $_POST["friend"] as $friend )
????: NamePros.com http://www.namepros.com/showthread.php?t=104086

Do you know what might be wrong?
Last edited by AndyM3; 07-04-2005 at 05:23 PM.
Ringr is offline  
Old 07-07-2005, 04:22 PM THREAD STARTER               #4 (permalink)
Senior Member
 
Ringr's Avatar
Join Date: Jul 2004
Posts: 1,383
Ringr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to behold
 



Meh, anybody?
Sorry I don't know PHP. :/
Ringr is offline  
Old 07-07-2005, 05:02 PM   #5 (permalink)
Senior Member
 
Eric's Avatar
Join Date: Mar 2005
Posts: 4,948
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
EDIT: Can't get it to work, I'll code my own.
Last edited by SecondVersion; 07-07-2005 at 05:45 PM.
Eric is offline  
Old 07-08-2005, 01:21 AM   #6 (permalink)
NamePros Member
Join Date: Aug 2004
Posts: 73
Crabby is an unknown quantity at this point
 



Thanks for being so patient </sarcasm>

I've updated the post.
__________________
michael
Crabby is offline  
Old 07-08-2005, 06:44 PM THREAD STARTER               #7 (permalink)
Senior Member
 
Ringr's Avatar
Join Date: Jul 2004
Posts: 1,383
Ringr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to beholdRingr is a splendid one to behold
 



It works!

Thank you Crabby!
And thanks for your efforts SecondVersion.

Thanks guys,
-Andy
Ringr is offline  
Old 07-08-2005, 06:52 PM   #8 (permalink)
Senior Member
 
Eric's Avatar
Join Date: Mar 2005
Posts: 4,948
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
Originally Posted by AndyM3
It works!
????: NamePros.com http://www.namepros.com/showthread.php?t=104086

Thank you Crabby!
And thanks for your efforts SecondVersion.

Thanks guys,
-Andy
Yea well lol, I got mine wrote, but you don't need it. Well, almost, still workin on it.
Eric is offline  
Old 07-11-2005, 03:57 AM   #9 (permalink)
NamePros Member
Join Date: Oct 2003
Posts: 126
i386 is an unknown quantity at this point
 



Just some suggestions...

If you have some people on dial-up that think their invite isn't going through, try to use the Dynamic Drive script to disable the click button.

If you're requesting them to send a message, use JavaScript as well and onClick. That will prevent people from filling out a blank form. Of course, it doesn't stop them from disabling JavaScript. It's always good to use empty() on top of JavaScript.
i386 is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
60.000 Templates, scripts, fonts, banners etc. $9.95 atkims Web Development Wanted 19 11-16-2004 10:48 AM
Domain Rating Script for Sale : $200.00 - only 10 scripts will be sold fonzerelli_79 Scripts For Sale 3 08-31-2003 09:41 AM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 08:43 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger