Home > php教程 > php手册 > body text

简单实现限定phpmyadmin访问ip的方法

WBOY
Release: 2016-06-13 11:55:15
Original
1208 people have browsed it

修改:config.inc.php

在第一行加入

$ip_prefix = '192.168.121.';
if (substr($_SERVER['REMOTE_ADDR'], 0, strlen($ip_prefix)) != $ip_prefix ) die('illegal access error');

ip可以设置成你自己电脑的ip。如果是内网建议直接设置成自己的ip地址取代ip地址段。这样的话可以防止其它用户在内网中访问。如果是公网ip限制,直接使用即可。

只是简单的限定,没有太大要求只是暂时限定,可以使用这种方式。临时性的限制用户去访问。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!