if ((isset($name) && ($name != "")) && (isset($email) && $email != ""))
{
if(!(isset($gender))) $gender=NULL;
if(!(isset($schoolYear))) $schoolYear=NULL;
if(!(isset($major))) $major=NULL;
if(!(isset($hometown))) $hometown=NULL;
if(!(isset($state))) $state=NULL;
if(!(isset($years190))) $years190=NULL;
if(!(isset($hsTeam))) $hsTeam=NULL;
if(!(isset($totalYears))) $totalYears=NULL;
if(!(isset($role))) $role=NULL;
if(!(isset($knowWPISponsor))) $knowWPISponsor=NULL;
if(!(isset($affectDecision))) $affectDecision=NULL;
if(!(isset($leatherman))) $leatherman=NULL;
if(!(isset($leathermanType))) $leathermanType=NULL;
if(!(isset($affectLife))) $affectLife=NULL;
if(!(isset($awards))) $awards=NULL;
if(!(isset($comments))) $comments=NULL;
if ($hsTeam == "N" || $hsTeam == NULL)
$oldTeam = 0;
if ($knowWPISponsor == "Y1" || $knowWPISponsor == "N1")
$affectDecision = $affectDecisionMA;
if ($knowWPISponsor == "Y2" || $knowWPISponsor == "N2")
$affectDecision = $affectDecisionOther;
else
$affectDecision = $affectDecisionWPI;
if ($knowWPISponsor == "Y1" || $knowWPISponsor == "Y2")
$knowWPISponsor = "Y";
if ($knowWPISponsor == "N1" || $knowWPISponsor == "N2")
$knowWPISponsor = "N";
//connect to mySQL server
include_once("./survey/db_connect.php");
if(! $link)
die("Couldn't connect to the server");
//connect to the database
mysql_select_db("first") or die ("Couldn't open the database");
$insert = "INSERT INTO survey (name, gender, email, schoolYear, major, hometown, state, years190, oldTeam, totalYears, role, knowWPISponsor, affectDecision, leatherman, leathermanType, affectLife, awards, comments) VALUES('".$name."','".$gender."','".$email."','".$schoolYear."','".$major."','".$hometown."','".$state."','".$years190."','".$oldTeam."','".$totalYears."','".$role."','".$knowWPISponsor."','".$affectDecision."','".$leatherman."','".$leathermanType."','".$affectLife."','".$awards."','".$comments."')";
mysql_query ($insert, $link) or die("Couldn't insert data into database");
//print $insert."
";
mysql_close($link);
?>
Dear ,
Thank you for filling out this survey. If you have any more questions please contact Nick Galotti or Ken Stafford.
Team 190.
}
else
{
?>
Welcome to Team 190's annual survey. Please take the time to fill out this short survey. This survey will be used for statistical purposes only. We only ask for name and email to make sure the information is valid.
Thank you for filling out this survey. If you have any more questions please contact Nick Galotti or Ken Stafford.
} ?>