Go back';
exit;
}
if($_POST['homeinst'] == '' OR $_POST['how'] == '') {
echo 'Error: not all fields were filled in. Go back';
exit;
}
$homeinst = trim($_POST['homeinst']);
$how = trim($_POST['how']);
$otherhow = trim($_POST['otherhow']);
$ipadr = $_SERVER["REMOTE_ADDR"];
$host = gethostbyaddr($ipadr);
// connect to database
if (!@mysql_connect('biocomplexity.indiana.edu', 'biocomp', 'Zahpqe0953')) {
header('Location: ./');
}
// select database
if (!@mysql_select_db('biocomp')) {
header('Location: ./');
}
$sql = "INSERT INTO grad_responses SET
HomeInstitution = '$homeinst',
How = '$how',
OtherHow = '$otherhow',
IPAdr = '$ipadr',
Host = '$host',
SubmitTime = now()";
if(mysql_query($sql)) {
echo 'Your input has been successfully submitted.
Thank you for your time.
Return to the main page';
}
else {
echo 'Thank you for your input.
Return to the main page';
}
} // end if data submitted
// otherwise print page
else {
echo '
To better faciliate our programs and reach out to potential students, we would greatly appreciate your submitting your input via the form below. All responses are submitted anonymously.
';
}
?>
|
|