Skip to content
This repository was archived by the owner on Sep 23, 2022. It is now read-only.

Commit a8ab2db

Browse files
author
nerdofcode
committed
Added mysql seperate access
1 parent 9a61450 commit a8ab2db

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

mysql.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
include "user.php";
3+
$query=$_SESSION['run_seperate'];
4+
$db = mysqli_connect('localhost',$user,$pass,$database) or die("<p style=\"color:red;\"><b>Error: </b> connection to MySQL failed. Please re-enter information and try again.</p>");
5+
mysqli_query($db, $query) or die("Query failed");
6+
$result = mysqli_query($db, $query);
7+
$row = mysqli_fetch_all($result, MYSQLI_ASSOC);
8+
$stringArray = json_encode($row);
9+
$stringArray = str_replace(",", "<br>", $stringArray);
10+
$stringArray = str_replace(array('[', ']', '}', '"'), "", $stringArray);
11+
$stringArray = str_replace("{", "<br>", $stringArray);
12+
$stringArray = str_replace(":", ": ", $stringArray);
13+
echo $stringArray;
14+
$mysqli_close($db);
15+
?>

shell.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<a href="logout.php">Logout</a>&ensp;
1616
<a href="options.php">Home</a><hr>
1717

18-
<form action="" name="query" id="query" method="post">
18+
<form action="" name="query" id="query" method="post" >
1919
SHELL: &nbsp;&nbsp;&ensp;&nbsp;&nbsp;<input type="text" id="query_box" name="query_box" placeholder="Ex: whoami"></input><br><br>
2020
<button type="Submit" value="Submit">Submit</button>
2121
</form>

0 commit comments

Comments
 (0)