mirror of
https://gitlab.com/JKANetwork/CheckServer.git
synced 2026-02-16 02:01:34 +01:00
First commit. Check if all is uploaded well.
This commit is contained in:
37
downdbcode.php
Executable file
37
downdbcode.php
Executable file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/** This PHP makes "download" files for database see. JKANetwork and DBWrapper involved...*/
|
||||
|
||||
$type = $_POST['dbcode_type']; //Database (SQLite3,MySQL...)
|
||||
$dbHost = $_POST['dbcode_host']; //Where it is.
|
||||
|
||||
switch($type){
|
||||
case 'sqlite3':
|
||||
$file = '<?php
|
||||
$conn = new SQLite3("'.$dbHost.'",SQLITE3_OPEN_READONLY) or die("FAIL");
|
||||
die("OK");
|
||||
?>';
|
||||
break;
|
||||
case 'mysqli':
|
||||
$dbUser = $_POST['dbcode_user'];
|
||||
$dbPass = $_POST['dbcode_pass'];
|
||||
$dbDb = $_POST['dbcode_db'];
|
||||
$file = '<?php
|
||||
mysqli_connect("'.$dbHost.'","'.$dbUser.'","'.$dbPass.'","'.$dbDb.'") or die("FAIL");
|
||||
die("OK");
|
||||
?>';
|
||||
break;
|
||||
case 'pgsql':
|
||||
$dbUser = $_POST['dbcode_user'];
|
||||
$dbPass = $_POST['dbcode_pass'];
|
||||
$dbDb = $_POST['dbcode_db'];
|
||||
$file = '<?php
|
||||
pg_connect("host='.$dbHost.' dbname='.$dbDb.' user='.$dbUser.' password='.$dbPass.'") or die ("FAIL");
|
||||
die("OK");
|
||||
?>';
|
||||
break;
|
||||
}
|
||||
|
||||
header ("Content-Disposition: attachment; filename=dbtest.php");
|
||||
header ("Content-Type: text/php");
|
||||
print $file;
|
||||
Reference in New Issue
Block a user