<?php session_start(); unset($_GET); $_GET = array(); $p0 = explode('&',file_get_contents('php://input')); foreach ($p0 as $key => $value) { $p1 = explode('=',$value); $_GET[$p1[0]] = $p1[1]; } function get_data($data) { $data = file_get_contents("data/$data.dat"); if(strcasecmp(substr(PHP_OS, 0, 3), 'WIN') == 0){ $data = explode("\r\n", $data); }else{ $data = explode("\n", $data); } return $data; } $ips = get_data("ips"); echo (in_array($_GET['ip'], $ips)) ? 'Y' : 'N'; exit; ?>
note get_data = array like 123,1.2.3.4, etc
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)