![]() |
|||||||||||||||||||||||||
|
For directions and other other information please click here ";
}
else if (isset($_POST['fname']) && isset($_POST['lname']) && isset($_POST['ad']) && isset($_POST['thect']) && isset($_POST['gid']))
{
$myGuestID = $_POST['gid'];
$willshow = $_POST['ad'];
$guestct = $_POST['thect'];
// INSERT RECORD IN DB
$db = mysql_connect("mysql1201.hostexcellence.com", "kpechin_rsvp", "rsvp_90210") or die('Could not connect to db' . mysql_error());
mysql_select_db('php', $db);
// SEE IF THEY ALREADY FILLED THIS IN
$result5 = mysql_query("SELECT * FROM kpechin_rsvp.guests a, kpechin_rsvp.rsvp b where a.responseid = b.responseid and b.responseid = $myGuestID", $db) or die("Query 5 failed: " . mysql_error());
if (mysql_num_rows($result5) == 0) {
$insertUser = mysql_query("INSERT INTO kpechin_rsvp.rsvp (responseid, willshow, guestct, regdatetime, filledOnline) VALUES ($myGuestID, $willshow, $guestct, Now(), 1)") or die("Query 3 failed: " . mysql_error());
$themsg = "Guest ID: " . $myGuestID . chr(10);
$themsg .= "Will Show: " . $willshow . chr(10);
$themsg .= "Guest Count: " . $guestct . chr(10);
$themsg .= "IP: " . $_SERVER["REMOTE_ADDR"];
mail("kpechin@gmail.com", "RSVP", $themsg);
}
echo "";
}
else if (isset($_POST['fname']) && isset($_POST['lname']))
{
$thefname = strtoupper($_POST['fname']);
// GUESTS CAN'T LOG IN - SHORT CIRCUIT HERE
if ($thefname == "GUEST") {
$thefname = "-----------";
}
$thelname = strtoupper($_POST['lname']);
$theresid = $_POST['rid'];
$db = mysql_connect("mysql1201.hostexcellence.com", "kpechin_rsvp", "rsvp_90210") or die('Could not connect to db' . mysql_error());
mysql_select_db('php', $db);
$result = mysql_query("SELECT * FROM kpechin_rsvp.guests WHERE (UCASE(fname) = '$thefname' OR UCASE(nick) = '$thefname') AND UCASE(lname)='$thelname' AND responseid = $theresid", $db) or die("Query 1 failed: " . mysql_error());
if (mysql_num_rows($result) > 0 )
{
// IF FIRST NAME AND LAST NAME MATCH THEN CHECK TO SEE IF THEY HAVE ALREADY REGISTERED
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$myGuestID = $row["responseid"];
// $result2 = mysql_query("SELECT * FROM kpechin_rsvp.rsvp WHERE responseid = $myGuestID", $db) or die("Query 2 failed: " . mysql_error());
$result2 = mysql_query("SELECT * FROM kpechin_rsvp.guests a, kpechin_rsvp.rsvp b where a.responseid = b.responseid and b.responseid = $myGuestID", $db) or die("Query 2 failed: " . mysql_error());
if (mysql_num_rows($result2) > 0)
{
echo "You have already filled in this form with the following data:
If this information is incorrect, please e-mail me at: kpechin@gmail.com or give either of our parents a call. For directions and other other information please click here "; } else { echo "
Please try again, or e-mail me at: kpechin@gmail.com"); echo ""; } } else { // QUERY FOR CURRENT TALLY /* $db = mysql_connect("mysql1201.hostexcellence.com", "kpechin_rsvp", "rsvp_90210") or die('Could not connect to db' . mysql_error()); mysql_select_db('php', $db); // SEE IF THEY ALREADY FILLED THIS IN $resultYes = mysql_query("SELECT sum(guestct) AS 'theCount' FROM kpechin_rsvp.rsvp WHERE willshow = 1", $db) or die("Query 5 failed: " . mysql_error()); $resultNo = mysql_query("SELECT sum(guestct) AS 'theCount' FROM kpechin_rsvp.rsvp WHERE willshow = 0", $db) or die("Query 5 failed: " . mysql_error()); echo (" Current Tally
"); */ echo("Thank you everyone who attended. We all had a great time and we hope to see everyone soon!"); /* echo(" "); */ } ?> |
||||||||||||||||||||||||