function DB_insert($query) { $link = DB_connect(); if ($link) { $result = mysql_query($query); } else { return false; } return $result; }
function login($argId, $argPasswd) { DB_connect(); $query = "select * from user_info where id = '" . $argId . "'"; $query_Result = getDB_value(transmit_query($_SESSION['conn'], $query)); if ($query_Result['id'] === $argId) { if ($query_Result['passwd'] === $argPasswd) { return 0; } else { return 1; } } else { return 2; } }
$ResponderDirectory = $ResponderDirectory . "/" . $directory_array[$i]; } $max_i = sizeof($directory_array) - 1; $this_file = $directory_array[$max_i]; } # Figure out the newline character if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { $newline = "\r\n"; } elseif (strtoupper(substr(PHP_OS, 0, 3) == 'MAC')) { $newline = "\r"; } else { $newline = ""; } # Connect to the DB $DB_LinkID = 0; DB_connect(); # Check the table install include_once 'check_install.php'; # Check the config $query = "SELECT * FROM InfResp_config"; $result = mysql_query($query) or die("Invalid query: " . mysql_error()); if (mysql_num_rows($result) < 1) { # Grab the vars $now = time(); $str1 = generate_random_block(); $str2 = generate_random_block(); # Setup the array $config['Max_Send_Count'] = '500'; $config['Last_Activity_Trim'] = '6'; $config['random_str_1'] = $str1; $config['random_str_2'] = $str2;
} // Begin to process the page... $iSearchString = $_POST['iSearchString']; if (empty($_POST['iSearchType'])) { if (empty($_GET['searchType'])) { $iObjectType = "user"; } else { $iObjectType = $_GET['searchType']; } } else { $iObjectType = $_POST['iSearchType']; } ?> <h2>Search for objects</h2> <?php /*echo "\$_POST['iSearchString']=".$_POST['iSearchString']."\n<br />"; echo "\$_POST['iSearchType']=".$_POST['iSearchType']."\n<br />"; echo "\$_GET['searchType']=".$_GET['searchType']."\n<br />"; echo "\$iSearchString=$iSearchString\n<br />"; echo "\$iObjectType=$iObjectType\n<br />";*/ ?> <h3>Help</h3> <p>Some help...</p> <?php display_search_form($iObjectType, $iSearchString); if (!empty($_POST['iSearchString'])) { echo " <h3>Results</h3>\n"; DB_connect($DB_host, $DB_login, $DB_pass); DB_select($DB_db); display_results($iSearchString, $iObjectType); }
<?php //Logging starten $LOG = new Log(); //DB öffnen DB_connect(DB_USER, DB_PASSWORD, DB_HOST, DB_PORT, DB_NAME); $LOG->write('3', 'startApplication.php:8:Datenbankverbindung hergestellt'); //Sprachdatei //noch automatisch die richtige Sprache wählen lassen include WPP_BASE . WPP_ROOT . "/lang/lang_de.php"; $LOG->write('3', 'startApplication.php:13:Sprache: de'); session_start(); $LOG->write('3', 'startApplication.php:16:Session gestartet'); // noch anpassen an erkannte Sprache...: //$_SESSION['lang']="de";