Because the security dog function is installed on the server, our direct sql cannot be used. Let me introduce to you how phpmyadmin solves this problem by changing the sql statement to base64 transmission.
1. First modify libraries/header.inc.php
Paste the js base64 function into line 61
2. Then modify js/sql.js
Find $("#sqlqueryform.ajax").live("submit",function(a){ This paragraph
Change to the following,
The code is as follows
代码如下 |
复制代码 |
$("#sqlqueryform.ajax").live("submit",function(a){
a.preventDefault();
var b=$(this);
if(!checkSqlQuery(b[0]))return false;
$(".error").remove();
var c=PMA_ajaxShowMessage(),e=$("#sqlqueryresults");
PMA_prepareForAjaxRequest(b);
$('#sqlquery').val( Base64.encode( $('#sqlquery').val() ) );
$.post(b.attr("action"),b.serialize(),function(d){
|
|
Copy code
|
$("#sqlqueryform.ajax").live("submit",function(a){
a.preventDefault();
var b=$(this);
if(!checkSqlQuery(b[0]))return false;
代码如下 |
复制代码 |
$sql_query=base64_decode($sql_query);
|
$(".error").remove();
var c=PMA_ajaxShowMessage(),e=$("#sqlqueryresults");
PMA_prepareForAjaxRequest(b);
$('#sqlquery').val( Base64.encode( $('#sqlquery').val() ) ); |
$.post(b.attr("action"),b.serialize(),function(d){
3.Last modification import.php
Import.php file line 24 insert
The code is as follows
|
Copy code
|
$sql_query=base64_decode($sql_query);
http://www.bkjia.com/PHPjc/632778.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632778.htmlTechArticleBecause the security dog function is installed on the server, our direct sql cannot be used. Let me explain to you below. Classmates introduce how phpmyadmin changes the sql statement to base64 transmission to solve...
|