Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<?php
/**
* FileMaker PHP Site Assistant Generated File
*/
require_once 'fmview.php';
require_once 'FileMaker.php';
require_once 'error.php';
$cgi = new CGI();
$cgi->storeFile();
$databaseName = 'questionnaire';
$layoutName = 'Questionnaire5';
$userName = $cgi->get('userName');
$passWord = $cgi->get('passWord');
$fm = & new FileMaker();
$fm->setProperty('database', $databaseName);
$fm->setProperty('username', $userName);
$fm->setProperty('password', $passWord);
ExitOnError($fm);
$layout = $fm->getLayout($layoutName);
ExitOnError($layout);
// formats for dates and times
$displayDateFormat = '%m/%d/%Y';
$displayTimeFormat = '%I:%M:%S %P';
$displayDateTimeFormat = '%m/%d/%Y %I:%M:%S %P';
$submitDateOrder = 'mdy';
// create the new add command
$newrecordrequest = $fm->newAddCommand($layoutName);
ExitOnError($newrecordrequest);
// get the submitted record data
$recorddata = $cgi->get('recorddata');
if (isset ($recorddata)) {
// submit the data to the db
$result = submitRecordData($recorddata, $newrecordrequest, $cgi, $layout->listFields());
// clear the stored record data
$cgi->clear('recorddata');
ExitOnError($result);
if ($result->getFetchCount() > 0) {
$records = $result->getRecords();
$record = $records[0];
}
}
ExitOnError($record);
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 20000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
if (file_exists("upload/" . $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" . $_FILES["file"]["name"]);
}
}
}
else
{
echo "";
}
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 20000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
if (file_exists("upload/" . $_FILES["file2"]["name"]))
{
echo $_FILES["file2"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["file2"]["tmp_name"],
"upload/" . $_FILES["file2"]["name"]);
}
}
}
else
{
echo "";
}
if(isset($_POST['email'])) {
// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "samanthastable@gmail.com";
$email_subject = "Your email subject line";
}
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}
// validation expected data exists
if(!isset($_POST['NameFirst']) ||
!isset($_POST['NameLast']) ||
!isset($_POST['Email']) ||
!isset($_POST['Phone 1']) ||
!isset($_POST['Age']) ||
!isset($_POST['OriginallyFrom']) ||
!isset($_POST['CurrentlyLive']) ||
!isset($_POST['SpecificEducation']) ||
!isset($_POST['Occupation']) ||
!isset($_POST['Work']) ||
!isset($_POST['IncomeLevel']) ||
!isset($_POST['Service']) ||
!isset($_POST['OtherMatchmakingServices']) ||
!isset($_POST['Hobbies']) ||
!isset($_POST['Pets']) ||
!isset($_POST['Referral']) ||
!isset($_POST['MaritalStatusl']) ||
!isset($_POST['KidStatus']) ||
!isset($_POST['Religion']) ||
!isset($_POST['YourLookDescrip']) ||
!isset($_POST['DateType']) ||
!isset($_POST['MICS'])) {
died('We are sorry, but there appears to be a problem with the form you submitted.');
}
$NameFirst = $_POST['NameFirst']; // required
$NameLast = $_POST['NameLast']; // required
$Email = $_POST['Email']; // required
$Phone1 = $_POST['Phone 1']; // required
$Age = $_POST['Age']; // required
$OriginallyFrom = $_POST['OriginallyFrom']; // required
$CurrentlyLive = $_POST['CurrentlyLive']; // required
$SpecificEducation = $_POST['SpecificEducation']; // required
$Occupation = $_POST['Occupation']; // required
$Work = $_POST['Work']; // required
$IncomeLevel = $_POST['IncomeLevel']; // required
$Service = $_POST['Service']; // required
$OtherMatchmakingServices = $_POST['OtherMatchmakingServices']; // required
$Hobbies = $_POST['Hobbies']; // required
$Pets = $_POST['Pets']; // required
$Referral = $_POST['Referral']; // required
$MaritalStatus = $_POST['MaritalStatus']; // required
$KidStatus = $_POST['KidStatus']; // required
$Religion = $_POST['Religion']; // required
$YourLookDescrip = $_POST['YourLookDescrip']; // required
$DateType = $_POST['DateType']; // required
$MICS = $_POST['MICS']; // not required
$file = $_POST['file']; // not required
$file2 = $_POST['file2']; // not required
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$Email)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
$string_exp = "/^[A-Za-z .'-]+$/";
if(!preg_match($string_exp,$NameFirst)) {
$error_message .= 'The First Name you entered does not appear to be valid.<br />';
}
if(!preg_match($string_exp,$NameLast)) {
$error_message .= 'The Last Name you entered does not appear to be valid.<br />';
}
if(strlen($Email) < 2) {
$error_message .= 'The Email you entered do not appear to be valid.<br />';
}
if(strlen($Phone1) < 2) {
$error_message .= 'The Phone Number you entered do not appear to be valid.<br />';
}
if(strlen($Age) < 2) {
$error_message .= 'Please provide your age.<br />';
}
if(strlen($OriginallyFrom) < 2) {
$error_message .= 'Please provide where you are Originally From.<br />';
}
if(strlen($CurrentlyLive) < 2) {
$error_message .= 'Please provide where you Currently Live.<br />';
}
if(strlen($SpecificEducation) < 2) {
$error_message .= 'Please provide where you attended to College/Grad School.<br />';
}
if(strlen($Occupation) < 2) {
$error_message .= 'Please provide your Occupation.<br />';
}
if(strlen($Work) < 2) {
$error_message .= 'Please provide where you work.<br />';
}
if(strlen($IncomeLevel) < 2) {
$error_message .= 'Please provide your income level.<br />';
}
if(strlen($Service) < 2) {
$error_message .= 'Please provide the service you are interested in.<br />';
}
if(strlen($OtherMatchmakingServices) < 2) {
$error_message .= 'Please provide if you have used other dating services.<br />';
}
if(strlen($Hobbies) < 2) {
$error_message .= 'Please provide your hobbies.<br />';
}
if(strlen($Pets) < 2) {
$error_message .= 'Please provide if you have pets.<br />';
}
if(strlen($Referral) < 2) {
$error_message .= 'Please provide how you heard about the service.<br />';
}
if(strlen($MaritalStatus) < 2) {
$error_message .= 'Please provide your Marital Status.<br />';
}
if(strlen($KidStatus) < 2) {
$error_message .= 'Please provide if you have or want kids.<br />';
}
if(strlen($Religion) < 2) {
$error_message .= 'Please provide your religion.<br />';
}
if(strlen($YourLookDescrip) < 2) {
$error_message .= 'Please provide your height, weight, and look.<br />';
}
if(strlen($DateType) < 2) {
$error_message .= 'Please provide the type of person you want to meet.<br />';
}
if(strlen($) < 2) {
$error_message .= 'The Comments you entered do not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "First Name: ".clean_string($NameFirst)."\n";
$email_message .= "Last Name: ".clean_string($NameLast)."\n";
$email_message .= "Email: ".clean_string($Email)."\n";
$email_message .= "Phone: ".clean_string($Phone1)."\n";
$email_message .= "Age: ".clean_string($Age)."\n";
$email_message .= "Originally From: ".clean_string($OriginallyFrom)."\n";
$email_message .= "Currently Live: ".clean_string($CurrentlyLive)."\n";
$email_message .= "Education: ".clean_string($SpecificEducation)."\n";
$email_message .= "Occupation: ".clean_string($Occupation)."\n";
$email_message .= "Work: ".clean_string($Work)."\n";
$email_message .= "IncomeLevel: ".clean_string($IncomeLevel)."\n";
$email_message .= "Service: ".clean_string($Service)."\n";
$email_message .= "Other Dating Service: ".clean_string($OtherMatchmakingServices)."\n";
$email_message .= "Hobbies: ".clean_string($Hobbies)."\n";
$email_message .= "Pets: ".clean_string($Pets)."\n";
$email_message .= "Referral: ".clean_string($Referral)."\n";
$email_message .= "Marital Status: ".clean_string($MaritalStatus)."\n";
$email_message .= "Kid Status: ".clean_string($KidStatus)."\n";
$email_message .= "Religion: ".clean_string($Religion)."\n";
$email_message .= "Your Look: ".clean_string($YourLookDescrip)."\n";
$email_message .= "Date Type: ".clean_string($DateType)."\n";
$email_message .= "Other Comments: ".clean_string($MICS)."\n";
$email_message .= "Image1: ".clean_string($file)."\n";
$email_message .= "Image2: ".clean_string($file2)."\n";
// create email headers
$headers = 'From: '.$Email."\r\n".
'Reply-To: '.$Email."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" media="screen" href="white.css">
<title>
Samantha's Table Registration Form Submission Successful!
</title>
</head>
<body>
<div id="header">
<!-- HEADER -->
<div id="headerlogo">
Samantha's Table
<div id="headercaption">
<!--Caption for the Company-->
</div>
</div>
</div>
<div id="content">
<!--Navigation Menu-->
<?php include_once 'navigation.php' ?>
<table cellpadding="0" cellspacing="0" class="contentbg">
<tr>
<td class="contentbgleft">
</td>
<td class="contentmidrecords">
<div id="contenttitlebg">
<!-- PAGE BODY -->
<h1>
Registration Form Confirmation
</h1>
</div>
<table class="message" cellpadding="0" cellspacing="0">
<tr>
<td class="messagedisplay">
Thank you for filling out the registration form. If you have filled out the form and uploaded your photos then we will be in touch with you shortly.
If you have not yet uploaded your photos then please email your photos within 24 to 48 hours to <a href=mailto:samanthastable@gmail.com>SamanthasTable@gmail.com</a>. Your registration will only be complete once we receive your photos.
</td>
</tr>
</table>
<table class="curvedbg">
<tr>
<td>
</td>
</tr>
</table>
<div class="scrolladd">
<table cellpadding="1" cellspacing="0" class="recwidth">
<tr>
<td valign="top">
<table cellpadding="1" cellspacing="6" class="record">
<!-- Display record field values -->
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('First Name:',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('NameFirst', 0, $record, true, 'EDITTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Last Name:',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('NameLast', 0, $record, true, 'EDITTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Email:',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('Email', 0, $record, true, 'EDITTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Phone Number:',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('Phone 1', 0, $record, true, 'EDITTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Age:',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('Age', 0, $record, true, 'EDITTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Where you are from originally?',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('OriginallyFrom', 0, $record, true, 'EDITTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Where do you live currently?',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('CurrentlyLive', 0, $record, true, 'EDITTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('College/grad school attended?',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('SpecificEducation', 0, $record, true, 'EDITTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Occupation?',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('Occupation', 0, $record, true, 'EDITTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Where do you work?',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('Work', 0, $record, true, 'EDITTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('What is your income level?',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('IncomeLevel', 0, $record, true, 'POPUPLIST', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Service',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('Service', 0, $record, true, 'POPUPLIST', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Have you tried online dating and/or used other matchmakers (which ones)?',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('OtherMatchmakingServices', 0, $record, true, 'SCROLLTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('What are your hobbies?',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('Hobbies', 0, $record, true, 'SCROLLTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Do you have pets? If so, describe:',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('Pets', 0, $record, true, 'SCROLLTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('How you heard about the service? (specifically)',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('Referral', 0, $record, true, 'SCROLLTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('What is your marital status?',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('MaritalStatus', 0, $record, true, 'EDITTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Children',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('KidStatus', 0, $record, true, 'SCROLLTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Religion:',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('Religion', 0, $record, true, 'EDITTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Your Height / Weight / Look:',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('YourLookDescrip', 0, $record, true, 'SCROLLTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Age / Type of person you want to meet:',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('DateType', 0, $record, true, 'SCROLLTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Other Comments:',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<?php echo nl2br(str_replace(' ', ' ', storeFieldNames('MICS', 0, $record, true, 'SCROLLTEXT', 'text')))?>
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Image1',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<img src="<?php echo getImageURL(storeFieldNames('Image1', 0, $record, true, 'EDITTEXT', 'container'))?>">
</td>
</tr>
<tr class="field">
<td class="field_name">
<?php echo str_replace(' ', ' ',htmlentities('Image2',ENT_NOQUOTES,'UTF-8',false));?>
</td>
</tr>
<tr class="field">
<td class="field_data">
<img src="<?php echo getImageURL(storeFieldNames('"upload/" . $_FILES["file2"]["name"]', 0, $record, true, 'EDITTEXT', 'container'))?>">
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
<td class="contentbgright">
</td>
</tr>
<tr>
<td class="contentbgfooterleft">
</td>
<td class="contentfooter">
</td>
<td class="contentbgfotterright">
</td>
</tr>
</table>
</div>
<!-- Footer-->
<table class="footerwidth" cellspacing="0" cellpadding="0">
<tr>
<td>
<?php include_once 'footer.php' ?>
</td>
</tr>
</table>
</body>
</html>