Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
bruneo32 authored Mar 16, 2021
1 parent bab3301 commit 3288104
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
4 changes: 3 additions & 1 deletion licenses.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
li *{
padding: 0;
}
.nomp{margin: 0;padding: 0;}
</style>
</head>
<body>
<img style="margin-top:-16px;" src="res/banner.jpg" alt=""><br>
<a target="_blank" href="https://github.com/bruneo32/phpmiami"><img src="https://img.shields.io/badge/version-1.0-cornflowerblue.svg" alt=""></a>
<a target="_blank" href="https://github.com/bruneo32/phpmiami"><img class="nomp" src="https://img.shields.io/badge/version-1.0-cornflowerblue.svg" alt=""></a>
<a target="_blank" href="https://github.com/bruneo32/phpmiami"><img class="nomp" src="https://img.shields.io/badge/license-CC0-orangered.svg" alt=""></a>
<br>
<br>

Expand Down
4 changes: 1 addition & 3 deletions main.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
<input type="checkbox" id="tableHint" onchange="GetTableHint()" checked/><label title="The code editor shows the tables of the database in the hints." for="tableHint">Hint tables</label>

<hr>

<a href="php/0.php">Import</a>
<a href="php/0.php">Export</a>

<a target="_blank" href="https://www.w3schools.com/sql/default.asp">Learn SQL</a>

<div style="float:right;height: 100%;padding: 0.25em 0;">
Expand Down
2 changes: 1 addition & 1 deletion php/100.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href=\"\">here</a>.<br><br><a href='../login'>Return</a>");}
if($h == "localhost"){die("For security reasons, conections to 'localhost' are bloqued. Learn more about localhost <a href=\"../doc/localhost.html\">here</a>.<br><br><a href='../login'>Return</a>");}
}
$u=$_REQUEST["u"];

Expand Down
15 changes: 12 additions & 3 deletions php/103.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,25 @@
$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);
for ($i=0; $i < count($tables); $i++) {
$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);
Expand All @@ -32,6 +42,5 @@
}
}


echo json_encode($array);
?>

0 comments on commit 3288104

Please sign in to comment.