columnName($i)); $str .= GetBlock(""); $type = SQLITE3_NULL; $length = 0; $flag = 0; $str .= GetLongBinary($type); $str .= GetLongBinary($flag); $str .= GetLongBinary($length); } echo $str; } function EchoData($res, $numfields, $numrows) { for ( $i = 0; $i < $numrows; $i++ ) { $str = ""; $row = sqlite_fetch_array( $res, SQLITE_NUM ); for( $j = 0; $j < $numfields; $j++ ) { if( is_null($row[$j]) ) $str .= "\xFF"; else $str .= GetBlock($row[$j]); $str .= GetLongBinary(-2); } echo $str; } } function EchoData3($res, $numfields, $numrows) { while ($row = $res->fetchArray(SQLITE3_NUM)) { $str = ""; for ( $j = 0; $j < $numfields; $j++ ) { if ( is_null($row[$j]) ) $str .= "\xFF"; else $str .= GetBlock($row[$j]); $str .= GetLongBinary($res->columnType($j)); } echo $str; } } function SQLite2($action, $path, $queries) { if (!function_exists("sqlite_open")) { EchoHeader(203); echo GetBlock("SQLite2 is not supported on the server"); exit(); } $errno_c = 0; $conn = sqlite_open($path, 0666, $error_c); if ($conn == FALSE) { $errno_c = 202; } EchoHeader($errno_c); if ($errno_c > 0) { echo GetBlock(sqlite_error_string($error_c)); } elseif($action == "C") { EchoConnInfo(); } elseif($action == "2") { sqlite_query($conn, "VACUUM"); EchoConnInfo(); } elseif($action == "Q") { for($i=0;$i 0) { EchoFieldsHeader($res, $numfields); EchoData($res, $numfields, $numrows); } else { echo GetBlock(""); } } if ($i<(count($queries)-1)) echo "\x01"; else echo "\x00"; } } sqlite_close($conn); } function SQLite3($action, $path, $queries) { if (!class_exists("Sqlite3")) { EchoHeader(203); echo GetBlock("SQLite3 is not supported on the server"); exit(); } $flag = SQLITE3_OPEN_READWRITE; if ($action == "3") $flag = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE; $errno_c = 0; $conn = new SQLite3($path, $flag); if ($conn == nil) { $errno_c = 202; } EchoHeader($errno_c); if ($errno_c > 0) { echo GetBlock(SQLite3::lastErrorMsg()); } else if($action == "C") { EchoConnInfo3(); } else if($action == "3") { $conn->query("VACUUM"); EchoConnInfo3(); } else if($action == "Q") { for($i=0;$iquery($query); $errno = $conn->lastErrorCode(); $affectedrows = $conn->changes(); $insertid = $conn->lastInsertRowID(); $numfields = 0; $numrows = 0; if (is_a($res, "SQLite3Result")) { $numfields = $res->numColumns(); if ($numfields > 0) { while ($row = $res->fetchArray(SQLITE3_NUM)) { $numrows++; } $res->reset(); } } EchoResultSetHeader($errno, $affectedrows, $insertid, $numfields, $numrows); if ($errno != 0) echo GetBlock($conn->lastErrorMsg()); else { if ($numfields > 0) { EchoFieldsHeader3($res, $numfields); EchoData3($res, $numfields, $numrows); $res->finalize(); } else { echo GetBlock(""); } } if ($i<(count($queries)-1)) echo "\x01"; else echo "\x00"; } } $conn->close(); } if (phpversion_int() < 50000) { EchoHeader(201); echo GetBlock("unsupported php version"); exit(); } if (!isset($_POST["actn"]) || !isset($_POST["dbfile"])) { $testMenu = $allowTestMenu; if (!$testMenu){ EchoHeader(202); echo GetBlock("invalid parameters"); exit(); } } if (!$testMenu){ if ($action == "2" || $action == "3") { if (!isset($_POST["version"])) { EchoHeader(202); echo GetBlock("invalid parameters"); exit(); } } if ($_POST["encodeBase64"] == '1') { for($i=0;$i$description$resStr[0]" : "class=\"TestFail\">$resStr[1]"; } output("[SQLite2] PHP version >= 5.0.0", phpversion_int() >= 50000, array("Yes", "No")); output("[SQLite2] sqlite_open() available", function_exists("pg_connect"), array("Yes", "No")); output("[SQLite3] PHP version >= 5.3.0", phpversion_int() >= 50300, array("Yes", "No")); output("[SQLite3] SQLite3 class available", class_exists("SQLite3"), array("Yes", "No")); if (phpversion_int() >= 40302 && substr($_SERVER["SERVER_SOFTWARE"], 0, 6) == "Apache" && function_exists("apache_get_modules")){ if (in_array("mod_security2", apache_get_modules())) output("Mod Security 2 installed", false, array("No", "Yes")); } } header("Content-Type: text/html"); ?> Navicat HTTP Tunnel Tester

Navicat™
The gateway to your database!

System Environment Test ">
PHP installed properlyNo

Server Test
Hostname/IP Address:
Port:
Initial Database:
Username:
Password:
Database File: