=1); } function mysql_exists($var,$val,$table) { $var = mysql_real_escape_string($var); // ALWAYS sanitize user input $val = mysql_real_escape_string($val); $table = mysql_real_escape_string($table); return (mysql_num_rows(mysql_query("SELECT * from `$table` where $var = '$val'"))>=1); } function redirect($r) { header("Location: $r"); exit(); } function login($user,$pass,$ip,$destination) { if(mysql_auth_user($user,$pass,"authentication")) { // success $_SESSION["username"] = $user; $_SESSION["password"] = $pass; redirect($destination); } } function logout() { unset($_SESSION["username"]); unset($_SESSION["password"]); notify("You have been logged out","secure"); } function logout_silent() { unset($_SESSION["username"]); unset($_SESSION["password"]); //notify("You have been logged out","secure"); } function send_email($to,$subject="Notification",$message="") { $from = 'no-reply@'.$_SERVER['HTTP_HOST']; $return_path = '-f '.$from; mail($to,$subject,$message,"From: $from\n This email was sent using X-Mailer: PHP/ . $phpversion()"); } function download($file) { header("Content-disposition: attachment; filename=$file"); header("Content-type: application/pdf"); readfile($file); exit; } function notify($msg,$class) { if(isset($msg)) { // NOTIFICATION IS A GO! ?>


No Readings Available for Period #

Reading List for Period #