Home > Backend Development > PHP Tutorial > 简单实现限定phpmyadmin访问ip的方法_php技巧

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

WBOY
Release: 2016-05-17 09:06:30
Original
1117 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限制,直接使用即可。

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

Related labels:
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template