<?php // pull in functions file, which includes dbConnect file $directory = dirname(dirname(__FILE__)); require_once $directory . '/functions.php'; // establish year and month for calendar $requestYear = rv('year', date('Y')); if (!preg_match('/^20[0-9]{2}$/', $requestYear)) { $requestYear = date('Y'); } $requestMonth = rv('month', date('n')); if (!is_numeric($requestMonth) || $requestMonth < 1 || $requestMonth > 12) { $requestMonth = date('n'); } $requestMonth = ltrim($requestMonth, '0'); if ($requestMonth * 1 < 10) { $requestMonth = '0' . $requestMonth; } ?> <ul class="breadcrumb expand"> <li><a href="http://www.library.ubc.ca" title="UBC Library">Library Home</a> <span class="divider">/</span></li> <li>Hours & Locations</li> </ul> <div class="grid"> <header id="hours-header"> <h1><a href="" title="Hours and Locations"><img src="img/hours-locations-header.gif" title="Hours and Locations" /></a></h1> </header>
$ref2 = "Ref2 changed"; } } echo "\n ---- Pass by ref / pass by val: functions ----\n"; unset($u1, $u2); v($u1); r($u2); var_dump($u1, $u2); unset($u1, $u2); vv($u1, $u2); var_dump($u1, $u2); unset($u1, $u2); vr($u1, $u2); var_dump($u1, $u2); unset($u1, $u2); rv($u1, $u2); var_dump($u1, $u2); unset($u1, $u2); rr($u1, $u2); var_dump($u1, $u2); echo "\n\n ---- Pass by ref / pass by val: static method calls ----\n"; unset($u1, $u2); C::v($u1); C::r($u2); var_dump($u1, $u2); unset($u1, $u2); C::vv($u1, $u2); var_dump($u1, $u2); unset($u1, $u2); C::vr($u1, $u2); var_dump($u1, $u2);
</head> <body> <!-- pre><?php print_r($_REQUEST); ?> </pre> <pre><?php print_r($_FILES); ?> </pre --> <?php $pre = rv("pre"); if (preg_match("/(^\\/|\\.\\.+|[^-_.\\/A-Za-z0-9]+)/", $pre)) { fail("Invalid storage area."); } $nukefile = rv("nukefile"); if ($nukefile) { @unlink($pre . "/" . $nukefile); } $u = $_FILES["fup"]; $file = $u['name']; if ($file) { if (!file_exists($pre)) { @mkdir($pre, 0775, true); } // sanitize filename $file = str_replace("\$", "", $file); $file = preg_replace("/\\.\\.+/", ".", $file); $file = preg_replace("/[^-_.A-Za-z0-9]+/", "", $file); $path = $pre . "/" . $file; if (!move_uploaded_file($u['tmp_name'], $path)) {
// pull in dbConnect file $directory = dirname(dirname(__FILE__)); require_once $directory . '/dbConnect.php'; require_once $directory . '/functions.php'; // create DOM document and add XML root to it $doc = new DOMDocument('1.0'); // we want a nice output $doc->formatOutput = true; $root = $doc->createElement('all_hours'); $root = $doc->appendChild($root); // get URL parameters and set other parameters $conditions = ''; $location_login = rv('location'); $timeframe = rv('timeframe'); $holiday = rv('holiday'); $type_name = rv('type', "Library"); $type_id = strtolower($type_name) == "reference" ? 3 : 2; $validLocations = array('asian', 'ikblc', 'koerner', 'law', 'woodward'); if (!empty($location_login) && array_search($location_login, $validLocations) === false) { $error = $doc->createElement('error'); $error = $root->appendChild($error); $etext = $doc->createTextNode("Invalid location parameter passed. Must be one of: 'asian', 'ikblc', 'koerner', 'law', 'woodward'."); $etext = $error->appendChild($etext); header('Content-Type: text/xml'); $xml = $doc->saveXML() . "\n"; echo $xml; exit; } else { // used with code below timeframe specific code if (!empty($location_login)) { $location_id = getID($location_login);