$COMMENT_LENGTH = 1000; include("php/Library.php"); $survey_table = "SORLSurvey"; // display header echoHeader(); // switch for the body switch ($_GET['op']) { case "Submit Survey": submitSurvey(); break; default: echoSurvey(); break; } // display footer echoFooter(); ///////////////////////////// // Functions //////////////// ///////////////////////////// function alreadyTakenSurvey() { global $survey_table; // check to see if the survey has been taken $ip = $_SERVER['REMOTE_ADDR']; $sql = " SELECT * FROM $survey_table WHERE IP = '$ip' AND DATE(Timestamp) = DATE(NOW()) "; $sqlobj = new SQLObj($sql); $data = $sqlobj->run(); if (sizeof($data) > 0) return true; else return false; } function echoAlreadyTakenError() { ?>