Config Protect by $_SESSION Var

Protect WordPress config file with a $_session var

session_start(); 

  if (!empty($_GET['admin'])) { $_SESSION['admin'] = $_GET['admin']; }	

  if ( $_SESSION['admin'] != "yes" ) {
	  $url_array = explode('/', $_SERVER['REQUEST_URI']);
	
	  if ($url_array[1] == "partnership" || $url_array[1] == "partnerships") { header("Location: http://www.xxxxx.com/partnerships/");die(); }else{ header("Location: http://www.xxxxxx.com/real-estate-services/");die(); } 	
	  
  }
Comments