4
I would like to know how I can block my site that is under maintenance and leave free access to two ips, I’m doing this way , but it only leaves free for one. I want you to be free for both of you .
$ip = '10.11.30.175';
$ip ='10.11.30.182';
if ( $_SERVER['REMOTE_ADDR'] != $ip )
die('Site em manutenção, voltaremos em instantes');
plays these two ip’s in an array and uses the in_array function to see if REMOTE_ADDR matches any of its values.
– Gabriel Rodrigues
You can compare this to an array (remember to use the function
in_array()
oror
. First your variable must be an array ;).– rray
@rray can so as answer the question , because I tried to do the way you said and nothing appears on screen .
– allan araujo
In your example you are overwriting the variable value
$ip
– rray
See my answer to this question at: http://answall.com/a/150386/31016
– Allan Andrade