session_start();
# Set the info for connecting to mySQL
$dbhost = 'mysql1.fluidhosting.com'; # Set the mySQL host name
$dbuser = 'aaron'; # Set the mySQL username
$dbpasswd = 'n3wd3al'; # Set the mySQL password
$dbname = 'aaron'; # Set the mySQL database to use
# Attempt to connect to the mySQL database. If it cannot connect, print out the mysql error message.
mysql_connect($dbhost, $dbuser, $dbpasswd) or die("Error connect to db: ". mysql_error());
# Select the mySQL database that contains all the HKN tables
mysql_select_db($dbname);
# Get the filename the user is downloading from the $_GET
$filename = $_GET['file'];
if (!$filename) $filename = $_POST['filename'];
$submitUniqname= $_POST['submitUniqname'];
if ($submitUniqname)
{
if (!$_SESSION['uniqname'])
{
$uniqname = $_POST['uniqname'];
$_SESSION['uniqname'] = $uniqname;
}
else $uniqname = $_SESSION['uniqname'];
if ($uniqname == "null" || $uniqname == " " || !$uniqname || $uniqname == "none" || $uniqname =="joeshmo" || $uniqname == "joeshmoe")
{
$uniqname = false;
$_SESION['uniqname'] = false;
$err = "
Please enter valid uniqname
";
}
}
# If the user has not yet entered the uniqname, ask for it
if (!$_SESSION['uniqname'])
{
?>
To ensure that not the entire class downloads these, and
only the people I have given the address, I would appreciate if you would enter
your uniqname. If you decide to try to get around it by typing "none" or "joeschmoe"
I can just as easily remove the timelines / term sheets from the web and not
provide you with the resource that I have graciously posted online. So please,
don't be a dick, just type in your real uniqname.
Please enter your uniqname to ensure that you are a University of Michigan student:
if ($err) echo $err; ?>