Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PHP] RSVP script anyone ???

1 view
Skip to first unread message

Carmen & Gene

unread,
Jun 23, 2001, 10:46:24 PM6/23/01
to
Hi all,

Does anyone out there have a PHP script that will serve as an input
form which are e-mailed to wedding invitees, in turn, linking them to a
form where they can RSVP their decision to attend the wedding or not and
how many they plan to bring?

Visit http://www.lunenburg.org/wedding/rsvp.php for an example of
exactly what I'm expecting to accomplish.

I've asked the web master of that site to share the code. No response
yet.

Thanks for any help anyone can provide. :-)

Gene Kelley


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general...@lists.php.net
For additional commands, e-mail: php-gene...@lists.php.net
To contact the list administrators, e-mail: php-lis...@lists.php.net

Richard Lynch

unread,
Jun 25, 2001, 3:42:41 AM6/25/01
to
Here's an RSVP script we use at http://uncommonground.com for our annual
Jeff Buckley birthday party tribute party every November 17th. :-)

It's PostgreSQL, and bound to have some crap you don't want, and missing
features you do want, but it's a start.

We found that there were people who called/emailed or even trust US Postal
anyway, so we had to integrate things by hand, and unless you plan on
getting married a lot :-), it's easier to do it once by hand than code up a
whole admin interface for you to add people to the online respondents...

Even if you're building a wedding-registry service portal site thingie,
you'll probably find that you'll have happier customers if you just email
them each RSVP and let them do their "real" RSVP off-line by hand.

PS Any Buckley fans should RSVP as early as possible. It pretty much sells
out the day we announce it. :-)

---- rsvp.sql -----
create sequence rsvpid;

create table rsvp(
id int4 default nextval('rsvpid'),
coming int2,
publiccoming int2,
publicname int2,
publicemail int2,
publiccomments int2,
name text,
email text,
comments text
);

create unique index rsvpidindex on rsvp(id);
--------------------
---- rsvp.htm ------
<?php
function font($size = 3){
return "<FONT FACE=Palatino,Arial SIZE=$size>";
}
?>
<HTML>
<HEAD><TITLE>RSVP - Buckley Birthday Bash</TITLE></HEAD>
<BODY BGCOLOR=FFFFFF LINK=663300 VLINK=663300 TEXT=663300 ALINK=663300>
<CENTER><B>
<?php font(6)?>RSVP - <A HREF=index.htm>Buckley Birthday
Bash</A></FONT><BR>
<?php font(2)?><A HREF="#rsvp">RSVP Here!</A></FONT>
</B></CENTER>
<?php
require 'connect.inc';
if (!$connection){
die('RSVP System Offline</FONT></BODY></HTML>');
}
if (isset($rsvp)){
$query = 'insert into rsvp (coming, publiccoming, publicname,
publicemail, publiccomments, name, email, comments) ';
$query .= 'values(' . (isset($coming) ? 1 : 0);
$query .= ', ' . (isset($publiccoming) ? 1 : 0);
$query .= ', ' . (isset($publicname) ? 1 : 0);
$query .= ', ' . (isset($publicemail) ? 1 : 0);
$query .= ', ' . (isset($publiccomments) ? 1 : 0);
$query .= ", '$name', '$email', '$comments')";
file://echo $query . "<BR>\n";
$insert = pg_exec($connection, $query) or die('RSVP System
Offline</FONT></BODY></HTML>');
mail('loudc...@aol.com', 'RSVP - Buckley Birthday Bash',
"$name\n$email\nis " . (isset($coming) ? '' : 'NOT ') . "coming\n$comments",
"From: $email\nReply-To: $email");
if (isset($subscribe)){
mail('ugfans-...@uncommonground.com', 'subscribe', 'subscribe',
"From: $email\nReply-To: $email");
}
}
$query = 'select name, email, comments, coming, publiccoming, publicname,
publicemail, publiccomments from rsvp order by coming desc, name';
$rsvp = pg_exec($connection, $query) or die('RSVP System
Offline</FONT></BODY></HTML>');
$rsvpcount = 0;
$comingcount = 0;
$privatecomingcount = 0;
$notcomingseparatorprinted = 0;

echo "<CENTER><TABLE CELLPADDING=5>\n";
echo " <TR><TD>" . font() . "<B>Name</B></FONT></TD><TD>" . font() .
"<B>Email</B></FONT></TD><TD>" . font() . "<B>Comments</B></TD></TR>\n";

while (list($name, $email, $comments, $coming, $publiccoming,
$publicname, $publicemail, $publiccomments) = @pg_fetch_row($rsvp,
$rsvpcount++)){
if (!$coming && !$notcomingseparatorprinted){
echo " <TR VALIGN=TOP><TD COLSPAN=3 ALIGN=CENTER><HR>" . font() .
"<I>Unable To Attend</I></TD></TR>\n";
$notcomingseparatorprinted = 1;
}
if ($publiccoming){
echo " <TR VALIGN=TOP>\n";
echo " <TD>" . font() . ($publicname ? $name : '') . "</FONT></TD>\n";
echo " <TD>" . font() . ($publicemail ? $email : '') .
"</FONT></TD>\n";
echo " <TD>" . font() . ($publiccomments ? $comments : '') .
"</FONT></TD>\n";
echo " </TR>\n";
}
else{
if ($coming){
$privatecomingcount++;
}
}
if ($coming){
$comingcount++;
}
}
if ($privatecomingcount){
echo " <TR><TD COLSPAN=3 ALIGN=CENTER><HR><I>" . font() . "And
$privatecomingcount more!</FONT></I></TD></TR>\n";
}
echo " <TR><TD COLSPAN=3 ALIGN=CENTER><HR><I>" . font() . "$comingcount
attendees and counting!</FONT>" . font(2) . "<BR>This count does not reflect
RSVPs of multiple people in one -- Fear not, the humans will look out for
you.</FONT></I></TD></TR>\n";
echo "</TABLE></CENTER>\n";
?>
<A NAME=rsvp>
<FORM ACTION=rsvp.htm METHOD=POST>
<CENTER><TABLE BORDER=1>
<TR>
<TD COLSPAN=3><?php echo font();?><I>
<P>
Due to the overwhelming amount of <A HREF=rsvp.htm>RSVP's</A> we have
received, we will no longer be taking them via the website.
All admittance after RSVP's have been let in, will be on a first
come, first served basis. Any other questions can be directed to
Uncommon Ground @ 773.929.0415
</P>
Thank You, Uncommon Ground<BR>
Feel Free To Sign Our <A HREF=../guestbook.htm>Guestbook</A> For
General Comments<BR>
You wish to join our <A
HREF=mailto:ugfans-...@uncommonground.com?subject=subscribe>Mailing
List</A> by sending an email:<BR>
To: ugfans-...@uncommonground.com<BR>
Subject: Subscribe
</I></FONT></TD>
</TR>
</TABLE></CENTER>
</FORM>
<?php include('../toolbar.htm');?>
</BODY>
</HTML>
<?php exit;?>
------------------------

--
WARNING ric...@zend.com address is an endangered species -- Use
c...@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm

Hugh Bothwell

unread,
Jun 24, 2001, 5:05:50 PM6/24/01
to
Looks pretty straightforward:

You need a database, a script/form to populate the database, a script to
email notifications, a registry script/form, and a report script.


> Does anyone out there have a PHP script that will serve as an input
> form which are e-mailed to wedding invitees, in turn, linking them to a

SELECT id, name, email FROM wedding WHERE replied='N'

for each row returned,

mail("$email", "Online wedding invitation",
"\nPlease visit http:/myserver/register.php?id=$id to register");

0 new messages