How am i using this module

saiprasad_saiprasad - November 11, 2009 - 13:26
Project:IP to Country
Version:6.x-1.2
Component:Code
Category:support request
Priority:critical
Assigned:Unassigned
Status:closed
Description

Hi every one, i am using ip2cc module.
I download the ip-to-country.csv.
And update the database.
Nearly 97,536 entries are filled in the table.
Every thing is fine.
But how am i using this module.
Sorry to say this.
I am a completely theming developer.
I want to redirect my website depending upon ip addresses.
I am using different front pages for different countries.
I created one default page for redirecting to the appropriate country front page..
How am i use the code in front page about redirection.

Any one help me.

#1

mrfelton - November 11, 2009 - 13:55
Status:active» fixed

This module only provides an api for converting IP address to country code. If you want to redirect, you should probably check out http://drupal.org/project/ip2locale

#2

saiprasad_saiprasad - November 12, 2009 - 05:04

Thank u mrfelton, i done with the query:
$remote_addr= ip_address();
$sql = "SELECT country_code FROM ip2cc WHERE inet_aton('" . $remote_addr . "') >= ip_from AND inet_aton('" . $remote_addr . "') <= ip_to";
$res = db_result(db_query($sql));

With the above result i am redirecting the page.
Any way thanks to ur reply

#3

System Message - November 26, 2009 - 05:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.