add two conditional statements to preg_match

jlknauff

New member
Aug 25, 2008
237
1
0
Can someone tell me how to add a second IP address to this?



PHP:
<?
  $visitor = $_SERVER['REMOTE_ADDR'];
  if (preg_match("/174.170.197.174/",$visitor)) {
        
  } 
   
else {        header('Location: http://www.domain.com/');
  };
   
  ?>
 


PHP:
<?
  $visitor = $_SERVER['REMOTE_ADDR'];
  if ( (preg_match("/174.170.197.174/",$visitor)) || (preg_match("/174.170.197.175/",$visitor)) ) {
        
  } 
   
else {        header('Location: http://www.domain.com/');
  };
   
  ?>

BTW: I'm a lazy fuck and I ALWAYS write it like this "/174.170.197.174/i" ... the i at the end means case insensitive and it won't make a difference with what you are doing. Just my old habits because I've been burned a few times when scraping.