2017-02-02 8 views
0

我认为phpmyadmin index.php执行时被称为config.inc.php

于是,我就在config.inc.php

/* 
* First server 
*/ 
$i++; 
/* Authentication type */ 
$cfg['Servers'][$i]['auth_type'] = 'cookie'; 
/* Server parameters */ 
$cfg['Servers'][$i]['host'] = $_GET['test']; // I changed here 
$cfg['Servers'][$i]['connect_type'] = 'tcp'; 
$cfg['Servers'][$i]['compress'] = false; 

和呼叫URL这样。

http://localhost/index.php?test=211.212.14.11 

但我得到显示主机错误,无法正常工作。 我该怎么办?

回答

1

而不是使用GET在这里,这是phpMyAdmin的消毒的,正确的语法是直接把IP地址或主机名中的指令,如$cfg['Servers'][$i]['host'] = '192.168.5.6';$cfg['Servers'][$i]['host'] = 'db.example.com';

如果你想能够定义在登录时任意一台主机,查看$cfg['AllowArbitraryServer']指令(当设置为true时,可以在登录页面上输入任何服务器)。

相关问题