From 3288104785741c4e7bea294c37da2fecf2ea4537 Mon Sep 17 00:00:00 2001 From: bruneo <39414624+bruneo32@users.noreply.github.com> Date: Tue, 16 Mar 2021 09:54:16 +0100 Subject: [PATCH] Add files via upload --- licenses.html | 4 +++- main.php | 4 +--- php/100.php | 2 +- php/103.php | 15 ++++++++++++--- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/licenses.html b/licenses.html index 5605ab1..8df5f5e 100644 --- a/licenses.html +++ b/licenses.html @@ -31,11 +31,13 @@ li *{ padding: 0; } + .nomp{margin: 0;padding: 0;}
- + +

diff --git a/main.php b/main.php index fdf7845..c80ede8 100644 --- a/main.php +++ b/main.php @@ -28,9 +28,7 @@
- - Import - Export + Learn SQL
diff --git a/php/100.php b/php/100.php index 889fd33..35dee0a 100644 --- a/php/100.php +++ b/php/100.php @@ -14,7 +14,7 @@ $hn=$h; if(!$_CONFIG["allow_localhost"]){ - if($h == "localhost"){die("For security reasons, conections to 'localhost' are bloqued. Learn more about localhost here.

Return");} + if($h == "localhost"){die("For security reasons, conections to 'localhost' are bloqued. Learn more about localhost here.

Return");} } $u=$_REQUEST["u"]; diff --git a/php/103.php b/php/103.php index 8c75a91..70b10ba 100644 --- a/php/103.php +++ b/php/103.php @@ -13,7 +13,17 @@ $conn=connect(); $array=array(); - $result=mysqli_query($conn,"SHOW TABLES"); + if($_SESSION["db"]==""){ + // HINT DATABASES + $q="SHOW DATABASES"; + $q2="SHOW TABLES FROM (a)"; + }else{ + // HINT TABLES + $q="SHOW TABLES"; + $q2="SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N'(a)'"; + } + + $result=mysqli_query($conn,$q); if(!$result){die();} $tables=mysqli_fetch_all($result); @@ -21,7 +31,7 @@ $a=strval($tables[$i][0]); $array[$a]=array(); - $result=mysqli_query($conn,"SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N'".$a."'"); + $result=mysqli_query($conn,str_replace("(a)",$a,$q2)); if(!$result){die();} $cols=mysqli_fetch_all($result); @@ -32,6 +42,5 @@ } } - echo json_encode($array); ?>