There is no research on PHP, and there is a page on the website that requires only on-campus access. Google has spent half a day trying to use the online materials for half a day, so I am in a hurry to use it, I had to send a post to Cu to ask, and soon I got the answer. It's good for the Forum. Haha, despite the suspicion of being lazy :) after the test, I have to study hard. No way, work is needed.
This is the simplest way to determine an independent IP address.
<? PHP
// Allowed IP Address
$ Allowip = array (
'1970. 168.1.11 ',
'1970. 168.1.22 ',
'1970. 168.1.33 ',
);
$ IP = $ _ server ["remote_addr"];
If (! In_array ($ IP, $ allowip ))
{
Echo "Access forbid! ";
Exit;
}
?>
<HTML> some contetn ....
The IP segment is also very simple:
<? PHP
// Allowed IP segments
$ Allowip = array (
'2017. 123 ',
'2017. 123 ',
'2017. 123 ',
);
$ IP = explode ('.', $ _ server ["remote_addr"]);
Array_pop ($ IP );
$ IP = implode ('.', $ IP );
If (! In_array ($ IP, $ allowip ))
{
Echo "Access forbid! ";
Exit;
}
?>
<HTML> some contetn ....