{"id":104,"date":"2009-01-21T20:24:42","date_gmt":"2009-01-21T18:24:42","guid":{"rendered":"http:\/\/atbliss.ru\/?p=104"},"modified":"2011-07-01T10:08:47","modified_gmt":"2011-07-01T08:08:47","slug":"ip-addresses-function-definition","status":"publish","type":"post","link":"https:\/\/atbliss.ru\/ip-addresses-function-definition\/","title":{"rendered":"\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 IP-\u0430\u0434\u0440\u0435\u0441\u0430"},"content":{"rendered":"
\r\nfunction getcountry($ip)<\/code>\r\n{<\/code>\r\nglobal $user, $password, $db, $server;<\/code>\r\n$dbh = mysql_connect($server, $user, $password);<\/code>\r\nmysql_select_db(\"$db\");<\/code>\r\n$country_exec = mysql_query(\"SELECT code FROM ips WHERE ip1<='$ip' AND ip2>='$ip'\");<\/code>\r\n$ccode_array = mysql_fetch_array($country_exec);<\/code>\r\n$result = $ccode_array['code'];<\/code>\r\nmysql_close($dbh);<\/code>\r\nif (empty($result)) $result = 1;<\/code>\r\nreturn $result;<\/code>\r\n}<\/code>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"function getcountry($ip) { global $user, $password, $db, $server; $dbh = mysql_connect($server, $user, $password); mysql_select_db(«$db»); $country_exec = mysql_query(«SELECT code FROM ips WHERE ip1<=’$ip’ AND ip2>=’$ip'»); $ccode_array = mysql_fetch_array($country_exec); $result = $ccode_array[‘code’]; mysql_close($dbh); if (empty($result)) $result = 1; return $result; }<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"yoast_head":"\n
\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 IP-\u0430\u0434\u0440\u0435\u0441\u0430<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n