Home >Backend Development >PHP Tutorial >Simple method to restrict phpmyadmin's access to IP_PHP Tutorial

Simple method to restrict phpmyadmin's access to IP_PHP Tutorial

WBOY
WBOYOriginal
2016-07-21 15:13:161122browse

Modify: config.inc.php

Add

on the first line

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

The IP can be set to the IP of your own computer. If it is an intranet, it is recommended to directly set it to your own IP address instead of the IP address segment. This will prevent other users from accessing the internal network. If it is a public network IP restriction, just use it directly.

It’s just a simple limitation. It’s just a temporary limitation without big requirements. You can use this method. Temporarily restrict user access.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/326546.htmlTechArticleModify: config.inc.php Add $ip_prefix = '192.168.121.' in the first line; if ( substr($_SERVER['REMOTE_ADDR'], 0, strlen($ip_prefix)) != $ip_prefix ) die('illegal access error'); ip can...
Statement:
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