* $icontemp [0-19] * $linetemp [0-19] */ $MOD_GSMOFF['VERS'] = ' no functionality'; /* * debug used data */ if ($debug) { Gsm_debug($regelsArr, __LINE__); Gsm_debug($settingArr, __LINE__); Gsm_debug($_POST, __LINE__); Gsm_debug($_GET, __LINE__); Gsm_debug($place, __LINE__); } /* * the output to the screen */ $regelsArr['hash'] = sha1(MICROTIME() . $_SERVER['HTTP_USER_AGENT']); $_SESSION['page_h'] = $regelsArr['hash']; if ($debug) { Gsm_debug($regelsArr, __LINE__); } switch ($regelsArr['mode']) { default: $parseViewArray = array('header' => "", 'message' => message($msg, $debug), 'return' => CH_LOGIN, 'module' => $regelsArr['module'], 'page_id' => $page_id, 'section_id' => $section_id, 'hash' => $regelsArr['hash'], 'recid' => "", 'memory' => "", 'kopregels' => "", 'description' => "", 'selection' => "", 'rapportage' => "", 'toegift' => ""); $prout .= Gsm_prout($TEMPLATE[2], $parseViewArray); break; } if (strstr($set_mode, "vers")) { $prout .= "<small>" . $regelsArr['modulen'] . $regelsArr['versie'] . $MOD_GSMOFF['VERS'] . "</small>"; }
<?php // setting ftp address $ftp_server = "118.98.232.125"; $ftp_port = 21; $ftp_user = "******"; $ftp_passwd = "amerta"; /* direct object methods */ require_once "ftp.class.php"; $ftp =& new FTP(); if ($ftp->connect($ftp_server, $ftp_port)) { // mark start time $start_time = MICROTIME(TRUE); if ($ftp->login($ftp_user, $ftp_passwd)) { $ftp->get("rkakl.mdb", "rkakl.mdb"); $ftp->delete("rkakl.mdb"); } else { echo "login failed: "; } $ftp->disconnect(); // mark end time $stop_time = MICROTIME(TRUE); // get the difference in seconds $time = $stop_time - $start_time; echo "Elapsed time was {$time} seconds."; } else { echo "connection failed: "; }
} $regelsArr['select'] .= sprintf($LINETEMP[2], "", $regelsArr['edit_ok'] ? $ICONTEMP[4] : "", $ICONTEMP[2], "", "", ""); break; default: // new list $msg['bug'] .= __LINE__ . '</br>'; $regelsArr['select'] .= $LINETEMP[1]; if (isset($settingArr['opinfo'])) { $regelsArr['select'] .= sprintf($LINETEMP[6], "", stripslashes(htmlspecialchars($settingArr['opinfo']))); } $regelsArr['select'] .= sprintf($LINETEMP[9], "", "", Gsm_next($regelsArr['search'], $regelsArr['n'], $regelsArr['seq'], $regelsArr['qty']), "", ""); $regelsArr['select'] .= sprintf($LINETEMP[2], "", $regelsArr['add_ok'] && $regelsArr['mode'] != 1 ? $ICONTEMP[3] : "", $regelsArr['mode'] == 1 ? $ICONTEMP[10] : "", $regelsArr['pdf_ok'] && $regelsArr['mode'] != 1 ? $ICONTEMP[11] : "", isset($regelsArr['filename_pdf']) ? sprintf($ICONTEMP[18], "", $regelsArr['filename_pdf']) : "", ""); break; } /* * display */ switch ($regelsArr['mode']) { case 9: // display // display default: // default $_SESSION['page_h'] = sha1(MICROTIME() . $_SERVER['HTTP_USER_AGENT']); $parseViewArray = array('header' => strtoupper($regelsArr['project']), 'page_id' => $page_id, 'section_id' => $section_id, 'kopregels' => $regelsArr['head'], 'description' => $regelsArr['descr'], 'message' => message($msg, $debug), 'selection' => $regelsArr['select'], 'return' => CH_RETURN, 'parameter' => $regelsArr['search'], 'sel' => $regelsArr['search'], 'module' => $regelsArr['module'], 'memory' => $regelsArr['memory'] . "|", 'toegift' => $regelsArr['toegift'], 'recid' => $regelsArr['recid'], 'rapportage' => $regelsArr['rapport'], 'hash' => $_SESSION['page_h']); $prout .= Gsm_prout($TEMPLATE[2], $parseViewArray); break; } if (strstr($set_mode, "vers")) { $prout .= "<small>" . $regelsArr['modulen'] . $regelsArr['versie'] . "</small>"; }
include "/var/www/andrix/Includes/energyfunctions.php"; $starttime = EXPLODE(' ', MICROTIME()); $starttime = $starttime[1] + $starttime[0]; //fixar lite datum,tid osv $datum = date("Y-m-d"); $tid = date("G:i"); $dag = date("d"); $manad = date("m"); $year = date("Y"); $timme = date("H"); $minut = date("i"); updateday(); updatemonth($manad); if ($tid == '00:00') { updatemonth($manad); updateyear(); } if ($tid == '06:00') { updatemonth($manad); } if ($tid == '12:00') { updatemonth($manad); updateyear(); } if ($tid == '18:00') { updatemonth($manad); } $mtime = EXPLODE(' ', MICROTIME()); $totaltime = $mtime[0] + $mtime[1] - $starttime; PRINTF('Page loaded in %.3f seconds.', $totaltime);
} break; default: # nothing } } $query = "SELECT * from `" . TABLE_PREFIX . "users`"; $result = $database->query($query); if ($database->is_error()) { echo $database->get_error(); } else { /** * Build hash * */ $temp = sha1(MICROTIME() . $_SERVER['HTTP_USER_AGENT']); $_SESSION['init_page_h'] = $temp; $form = "\n<form method='post' action='" . ADMIN_URL . "/admintools/tool.php?tool=initial_page'>\n"; $form .= "\n<input type='hidden' name='job' value='save' />\n"; $form .= "\n<input type='hidden' name='sh' value='" . $temp . "' />\n"; $form .= "<table class='initial_page'>\n"; $form .= "<tbody>\n"; $form .= "<tr>\n <td class='head left'>" . $MOD_INITIAL_PAGE['label_user'] . "</td>\n <td class='head right'>" . $MOD_INITIAL_PAGE['label_page'] . "</td>\n <td class='head param'>" . $MOD_INITIAL_PAGE['label_param'] . "</td>\n </tr>\n"; while (false != ($data = $result->fetchRow(MYSQL_ASSOC))) { $temp_info = $ref->get_user_info($data['user_id']); $select = $ref->get_backend_pages_select("init_page_select[user_" . $data['user_id'] . "]", $temp_info['init_page']); $form .= "<tr><td class='left'>" . $data['user_id'] . " " . $data['username'] . "</td><td class='right'>" . $select . "</td><td class='param'><input type='text' name='param[" . $data['user_id'] . "]' value='" . $temp_info['page_param'] . "' /></td></tr>\n"; } $form .= "<tr><td class='left'> </td><td class='right'><input type='submit' value='" . $TEXT['SAVE'] . "' /></td></tr>\n"; $form .= "\n</tbody>\n</table>\n"; $form .= "</form>\n\n";
<?php $version = "0.1.0"; $start_time = MICROTIME(TRUE); //Including the various user-defined settings require_once 'settings.php'; //Creating the session if (session_id() == '') { session_start(); } // If debug mode has been set, this loads it. if (DEBUG_MODE) { error_reporting(E_ALL); ini_set('display_errors', 1); } // Loading the PhealNG API Library and Namespace require_once DOCUMENT_ROOT . '/vendor/autoload.php'; use Pheal\Pheal; use Pheal\Core\Config; Config::getInstance()->cache = new \Pheal\Cache\MemcacheStorage(); Config::getInstance()->access = new \Pheal\Access\StaticCheck(); // Loading the non-OOP functions require_once 'functions.php'; require_once 'new_functions.php'; // Setting up our Class autoloader require_once DOCUMENT_ROOT . '/classes/autoloader.php'; spl_autoload_register('Autoloader::load', TRUE); // Loading the Password Compatability file for PHP systems below 5.5. if (version_compare(phpversion(), '5.5.0', '<')) { require_once 'password.php'; }
if (Session::get('user_logged_in')) { ?> <ul class="nav navbar-nav navbar-right"> <li> <a href="<?php echo URL . 'login/logout'; ?> ">Logga ut</a> </li> </ul> <?php } ?> </div><!--/.nav-collapse --> </div><!--/Fixed navbar--> <?php require $this->viewFile; ?> <div> <?php echo 'Sidan tog ' . (MICROTIME(TRUE) - starting_time_measure) . ' sekunder att ladda'; ?> </div> </div> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="<?php echo URL; ?> public/js/bootstrap.js"></script> </body> </html>
<?php define('URL', 'http://192.168.56.101/PHP-movie-database/'); define('DB_FLAG', ''); define('SITE', 'MOVIEDB'); define('TITLE', 'FilmDB | '); define("starting_time_measure", MICROTIME(TRUE)); //DB-configuration define('SQL_ENGINE', 'mysql'); define('SQL_HOST', 'localhost'); define('SQL_DB', 'db'); define('SQL_USER', 'root'); define('SQL_PASS', 'abc123'); define('SQL_PORT', '3306'); define('SQL_ENGINE', 'mysql');
function drUpload() { // Script start time $start_time = MICROTIME(TRUE); // Allow access to the global (scope) variables. global $drNotice, $error, $truTarget, $druTarget, $uFileName, $last_id; // Generate the 40-bit SHA1 file hash for simple dup lookup. $shaHash = sha1_file($truTarget . $uFileName); // Retrieve the MD5 fingerprint for storage in the database. $md5Fingerprint = createFingerprint($truTarget . $uFileName); // Make sure we aren't accidentally overwriting anything this time. if (file_exists($druTarget . $uFileName)) { // Upload will cause more than one file with the same name in the directory? Error. $error = '<p><strong>ERROR:</strong> Filename uniqueness not preserved.<br />Please try again or contact the webmaster if this problem persists.</p>'; } else { // Uniqueness check... $dupResponse = simpleDupCheck($truTarget . $uFileName, $shaHash, $druTarget, $md5Fingerprint); if ($dupResponse !== null) { // Every image gets a new handle, even if it's in the reduced folder. (For consistency) $newiHandle = createImageHandle(6); try { // Exact dup found, add to DB and respond appropriately. $stmt = $GLOBALS["conn"]->prepare('INSERT INTO share_tracker (ILookup, IName, directory, uMethod) VALUES (:imageHandle,:imageName,:directory,:uMethod)'); $stmt->execute(array(':imageHandle' => $newiHandle, ':imageName' => $dupResponse, ':directory' => 'uploads_reduced', ':uMethod' => '1')); // Get the last INSERT ID $last_id = $GLOBALS["conn"]->lastInsertId(); // Report back a success! $drNotice = "<p><strong>NOTICE:</strong> Image was not added to duplicate reduced directory, file already exists.</p>" . "<br />" . "<p>To share your image, use the following link: " . "<a href=\"http://skynetgds.no-ip.biz/srthesis/irc.php?view={$newiHandle}\">http://skynetgds.no-ip.biz/srthesis/irc.php?view={$newiHandle}</a></p>"; } catch (PDOException $e) { // Or a failure... $error = '<p><strong>ERROR:</strong> ' . $e->getMessage() . '</p>'; } // Unique so actually upload the file! } else { // Create an image handle for the duplicate reduced link. $drImageHandle = createImageHandle(6); // Globally rename the file using this original filename. $relinkFileName = renameFile($uFileName, $drImageHandle); // Copy image to dup reduced and see if success. if (copy($truTarget . $uFileName, $druTarget . $relinkFileName)) { // Create a thumbnail for lightweight public viewing. makeThumb($druTarget, $GLOBALS["publicThumbTarget"], $relinkFileName, $GLOBALS["publicThumbSize"]); try { // Add the image to the database! $stmt = $GLOBALS["conn"]->prepare('INSERT INTO share_tracker (ILookup, IName, directory, uMethod, hash, fingerprint) VALUES (:imageHandle,:imageName,:directory,:uMethod, :shaHash, :fingerprint)'); $stmt->execute(array(':imageHandle' => $drImageHandle, ':imageName' => $relinkFileName, ':directory' => 'uploads_reduced', ':uMethod' => '1', ':shaHash' => $shaHash, ':fingerprint' => $md5Fingerprint)); // Get the last INSERT ID $last_id = $GLOBALS["conn"]->lastInsertId(); // Report a success! $drNotice = "<p><strong>NOTICE:</strong> The image was unique and added to duplicate reduced directory!</p>" . "<br />" . "<p>To share your image, use the following link: " . "<br />" . "<a href=\"http://skynetgds.no-ip.biz/srthesis/irc.php?view={$drImageHandle}\">http://skynetgds.no-ip.biz/srthesis/irc.php?view={$drImageHandle}</a></p>"; } catch (PDOException $e) { // Or a failure... $error = '<p><strong>ERROR:</strong> ' . $e->getMessage() . '</p>'; } } else { $error = '<p><strong>ERROR!</strong> File could not be saved to the server.<br />Please retry or contact the webmaster if this problem persists.</p>'; } } } // Mark the stop time $time = MICROTIME(TRUE) - $start_time; try { // Update the image processing time! $stmt = $GLOBALS["conn"]->prepare('UPDATE share_tracker SET processTime=:procTime WHERE ID=:lastID'); $stmt->execute(array(':procTime' => $time, ':lastID' => $last_id)); } catch (PDOException $e) { // Or an error... $error = '<p><strong>ERROR:</strong> ' . $e->getMessage() . '</p>'; } }
} break; default: $_SESSION['Node'] = 0; $_SESSION['Opened_Folder'][0] = 1; } //BUILDING THE FINAL RESULT - THE WEB HTML PAGE PAGEDIR_HEADER("DIRTREEVIEW", "DIRTREEVIEW - FILE MANAGER", "", ""); // finally create html code to build the page TABLEDIR_HEADER("#cccccc", ""); // table above the treeview TABLEDIR_SUBHEADER("", ""); // building the table to show the treeview // following lines to display the first row only for the root COLUMN_FOLDER(0, "", ""); COLUMN_FILES(0, "", ""); COLUMN_FILENAMES_ROOT("", ""); COLUMN_SIZE(0, "", ""); COLUMN_DATE(0, "", ""); DISPLAY_TREE(); // calling the function to show the dir treeview. // finish the benchmark $MTIME = MICROTIME(); $MTIME = EXPLODE(" ", $MTIME); $MTIME = $MTIME[1] + $MTIME[0]; $ENDTIME = $MTIME; $_SESSION['Total_Time'] = $ENDTIME - $STARTTIME; TABLEDIR_FOOTER("black", "yellow"); //table below the treeview PAGE_FOOTER("", ""); //finish the web page