MSV FM

dot.antimicrobial@66.96.161.157: ~ $
Path : /hermes/sb_web/b2432/ymcamedia.ipower.com/forms/
File Upload :
Current < : /hermes/sb_web/b2432/ymcamedia.ipower.com/forms/visitform.php

<?php
$refer = getenv("HTTP_REFERER"); 
$browser = getenv("HTTP_USER_AGENT"); 
$ip = getenv("REMOTE_ADDR");
if (is_null($_POST['ReturnTo'])) {
	$return = "http://pcy.ymcaatlanta.org";
} else {
	$return = $_POST['ReturnTo'];
}

$errorResult = "";
$csvFile = "visit_formresults.csv";
$fh = fopen($csvFile, 'a') or header("Location: $return");

$stringData = "$refer,$browser,$ip";

$body = "Referring web page:  $refer\n";
$body .= "Submitter's web browser:  $browser\n";
$body .= "Submitter's IP address:  $ip\n";
$body .= "Returned submitter to:  $return\n\n";

extract($_POST);

$stringData .= ",$tf1,$tf2,$tf3,$tf4,$tf5,$tf6,$tf7,$tf8,$tf9,$tf10,$tf11,";

$body .= "Date : $tf1\nTour card completed by : $tf2\nName : $tf3\n";
$body .= "Address : $tf5\nCity : $tf7\nState : $tf8\nZip : $tf9\n";
$body .= "AM Phone : $tf4\nPM Phone : $tf6\nE-Mail : $tf10\n";
$body .= "How Did You Hear About This YMCA? : $tf11\n\n";

if (!is_null($rg1)) {
	switch($rg1) {
		case 1:
			$stringData .= "I Currently don't exercise and I don't intend to start in the next 6 months,";
			$body .= "I Currently don't exercise and I don't intend to start in the next 6 months\n\n";
			break;
		case 2:
			$stringData .= "I Currently don't exercise but I am thinking about starting in the next 6 months,";
			$body .= "I Currently don't exercise but I am thinking about starting in the next 6 months\n\n";
			break;
		case 3:
			$stringData .= "I currently exercise some but not regularily,";
			$body .= "I currently exercise some but not regularily\n\n";
			break;
		case 4:
			$stringData .= "I currently exercise 3 or more times per week for 20 minutes or more each time and I have done so for less than 6 months,";
			$body .= "I currently exercise 3 or more times per week for 20 minutes or more each time, and I have done so for less than 6 months\n\n";
			break;
		case 5:
			$stringData .= "I currently exercise 3 or more times per week for 20 minutes or more each time and I have done so for longer then 6 months,";
			$body .= "I currently exercise 3 or more times per week for 20 minutes or more each time, and I have done so for longer then 6 months\n\n";
			break;
	}
} else {
	$errorResult .= "You did not CHECK THE PHRASE THAT BEST DESCRIBES YOUR PRESENT EXERCISE LEVEL.<br><br>\n";
}

if (!is_null($rg2)) {
	$stringData .= "$rg2,";
	$body .= "PRIMARY USERS(S) : $rg2\n\n";
} else {
	$errorResult .= "You did not select a PRIMARY USERS(S).<br><br>\n";
}

if (!is_null($rg3)) {
	$stringData .= "$rg3,";
	$body .= "PREFERRED WORKOUT SETTINGS : $rg3\n\n";
} else {
	$errorResult .= "You did not select a PREFERRED WORKOUT SETTINGS.<br><br>\n";
}

if (!is_null($rg4)) {
	$stringData .= "$rg4,";
	$body .= "PREVIOUS HISTORY WITH THE YMCA : $rg4\n\n";
} else {
	$errorResult .= "You did not select a PREVIOUS HISTORY WITH THE YMCA.<br><br>\n";
}
 
$stringData .= "$ta1,";
$body .= "Notes : $ta1\n\n";

$check_data = "$cb1"."$cb2"."$cb3"."$cb4"."$cb5"."$cb6"."$cb7"."$cb8"."$cb9"."$cb10"."$cb11"."$cb12"."$cb13"."$cb14"."$cb15"."$cb16"."$cb17"."$cb18";
if (empty($check_data)) {
	$errorResult .= "You did not select a CHECK PREFERRED HOURS(S) OF DAY FOR USAGE.<br><br>\n";
} else {
	$stringData .= "$cb1,$cb2,$cb3,$cb4,$cb5,$cb6,$cb7,$cb8,$cp9,$cb10,$cb11,$cb12,$cb13,$cb14,$cb15,$cb16,$cb17,$cb18,";
	$body .= "Preferred hour(s) of usage : $cb1 $cb2 $cb3 $cb4 $cb5 $cb6 $cb7 $cb8 $cp9 $cb10 $cb11 $cb12 $cb13 $cb14 $cb15 $cb16 $cb17 $cb18\n\n";
}

$check_data = $cb19.$cb20.$cb21.$cb22.$cb23.$cb24.$cb25;
if (empty($check_data)) {
	$errorResult .= "You did not select a CHECK PREFERRED DAY(S) OF THE WEEK FOR USAGE.<br><br>\n";
} else {
	$stringData .= "$cb19,$cb20,$cb21,$cb22,$cb23,$cb24,$cb25,";
	$body .= "Preferred day(s) of usage : $cb19 $cb20 $cb21 $cb22 $cb23 $cb24 $cb25\n\n";
}

$check_data = $cb26.$cb27.$cb28.$cb29.$cb30.$cb31.$cb32.$cb33;
if (empty($check_data)) {
	$errorResult .= "You did not select any GOALS.<br><br>\n";
} else {
	$stringData .= "$cb26,$cb27,$cb28,$cb29,$cb30,$cb31,$cb32,$cb33,";
	$body .= "Goals : $cb26 $cb27 $cb28 $cb29 $cb30 $cb31 $cb32 $cb33\n\n";
}

$check_data = $cb34.$cb35.$cb36.$cb37.$cb38.$cb39.$cb40;
if (empty($check_data)) {
	$errorResult .= "You did not select any PREFERRED ACTIVITY.<br><br>\n";
} else {
	$stringData .= "$cb34,$cb35,$cb36,$cb37,$cb38,$cb39,$cb40,";
	$body .= "Preferred Activity : $cb34 $cb35 $cb36 $cb37 $cb38 $cb39 $cb40\n\n";
}

$check_data = $cb41.$cb42.$cb43.$cb44.$cb45.$cb46.$cb47.$cb48.$cb49.$cb50;
if (empty($check_data)) {
	$errorResult .= "You did not select any PROGRAM INTERESTS .<br><br>\n";
} else {
	$stringData .= "$cb41,$cb42,$cb43,$cb44,$cb45,$cb46,$cb47,$cb48,$cb49,$cb50,";
	$body .= "Program Interests : $cb41 $cb42 $cb43 $cb44 $cb45 $cb46 $cb47 $cb48 $cb49 $cb50\n\n";
}
 
$stringData .= "$ta2,$ta3,$cb51";
$body .= "SPECIFIC AREAS ON WHICH YOU WOULD LIKE ADDITIONAL INFORMATION : $ta2\n\n";
$body .= "SPECIAL NEEDS YOU OR A FAMILY MEMBER HAVE : $ta3\n\n";
if (!is_null($cb51)) {
	$body .= "Requested FINANCIAL ASSISTANCE\n\n";
}

$stringData .= "," . date("F j, Y, g:i a") . "\n";

if (empty($errorResult)) {
	mail("hestas@visionzserver.com", "Survey Results", $body, "From: webmaster@ymcamedia.com");
	fwrite($fh, $stringData);
	fclose($fh);
	header("Location: $return");
} else {
	fclose($fh);
	echo "The following errors were reported.<br>Please hit the BACK button on your browser and correct the following errors.<br><br>\n";
	echo $errorResult;
}
 
?>