- <form method=GET action=query.php>
- <input type=text name=user value=testacct /><input type=text name=pass value=testacct123 />
- <br />
- <textarea rows=10 cols=50 name=query></textarea>
- <br />
- <input type=submit value=Query>
- </form>
- <?php
- $user = $_GET['user'];
- $pass = $_GET['pass'];
- $query = $_GET['query'];
- $cmd = "mysql -u $user -h localhost --password=$pass -e \"$query\"";
- print "Query: $cmd <br/>";
- $a = shell_exec($cmd);
- $a = "<TR><TD>" . $a;
- $a = str_replace("\n", "</td></tr><tr><td>\n", $a);
- $a = str_replace("\t", "</td><td>", $a);
- $a = $a . "</TR></TD>";
- print "<TABLE>";
- print $a;
- print "</TABLE>"
- ?>
Undefined
By: Guest | Date: Apr 16 2014 05:28 | Format: None | Expires: never | Size: 708 B | Hits: 941
Latest pastes
1 days ago
3 days ago
3 days ago
4 days ago
5 days ago