9

Is there a way to add an if so that some script will only run for users using a specific ip address.

mario
  • 141,508
  • 20
  • 234
  • 284
colinam1992
  • 318
  • 1
  • 3
  • 13
  • 1
    And for reference: [How to get the client IP address in PHP?](http://stackoverflow.com/q/3003145) – mario Mar 08 '15 at 19:04

1 Answers1

36

You can use if.

If your ip address is : 111.111.111.111

if($_SERVER["REMOTE_ADDR"]=='111.111.111.111'){
//run only my ip
}
manowar_manowar
  • 1,198
  • 2
  • 15
  • 32