9

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

mario
  • 144,265
  • 20
  • 237
  • 291
colinam1992
  • 338
  • 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

40

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,215
  • 2
  • 16
  • 32