[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

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


Closed Thread
 
LinkBack Thread Tools
Old 07-04-2005, 03:10 PM   #1 (permalink)
Senior Member
 
Ringr's Avatar
 
Join Date: Jul 2004
Posts: 1,391
1,090.86 NP$ (Donate)

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 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.



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, 03:21 PM   #2 (permalink)
NamePros Member
 
Join Date: Aug 2004
Posts: 74
50.00 NP$ (Donate)

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];
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!
<?php
}
?>

Last edited by Crabby; 07-08-2005 at 12:24 AM.
Crabby is offline  
Old 07-04-2005, 03:59 PM   #3 (permalink)
Senior Member
 
Ringr's Avatar
 
Join Date: Jul 2004
Posts: 1,391
1,090.86 NP$ (Donate)

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 behold


Everytime I say the thing about Hotscripts, at least one person replies like you did. :P
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 )

Do you know what might be wrong?

Last edited by AndyM3; 07-04-2005 at 04:23 PM.
Ringr is offline  
Old 07-07-2005, 03:22 PM   #4 (permalink)
Senior Member
 
Ringr's Avatar
 
Join Date: Jul 2004
Posts: 1,391
1,090.86 NP$ (Donate)

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 behold


Meh, anybody?
Sorry I don't know PHP. :/
Ringr is offline  
Old 07-07-2005, 04:02 PM   #5 (permalink)
NPQ's PA, Slave, and On Call Coder

Technical Services

 
Eric's Avatar
 
Join Date: Mar 2005
Posts: 4,545
0.71 NP$ (Donate)

Eric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond repute

Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse
EDIT: Can't get it to work, I'll code my own.
__________________

Last edited by SecondVersion; 07-07-2005 at 04:45 PM.
Eric is offline  
Old 07-08-2005, 12:21 AM   #6 (permalink)
NamePros Member
 
Join Date: Aug 2004
Posts: 74
50.00 NP$ (Donate)

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, 05:44 PM   #7 (permalink)
Senior Member
 
Ringr's Avatar
 
Join Date: Jul 2004
Posts: 1,391
1,090.86 NP$ (Donate)

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 behold


It works!

Thank you Crabby!
And thanks for your efforts SecondVersion.

Thanks guys,
-Andy
Ringr is offline  
Old 07-08-2005, 05:52 PM   #8 (permalink)
NPQ's PA, Slave, and On Call Coder

Technical Services

 
Eric's Avatar
 
Join Date: Mar 2005
Posts: 4,545
0.71 NP$ (Donate)

Eric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond repute

Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse
Quote:
Originally Posted by AndyM3
It works!

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, 02:57 AM   #9 (permalink)
NamePros Member
 
Join Date: Oct 2003
Posts: 126
251.90 NP$ (Donate)

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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 09:48 AM
Domain Rating Script for Sale : $200.00 - only 10 scripts will be sold fonzerelli_79 Scripts For Sale 3 08-31-2003 08:41 AM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 12:39 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85