Jul 20, 2008

How To Forward Url According To The Ip?

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

How To Forward Url According To The Ip?

whistle
Do you ever see that a website support multiple language, and the website will forward you to a homepage written by one of the language according to your ip address.

That is, the website has multiple sets of pages. Each set of pages is writted by a specific language. When you link to the website, it can determine your ip and country you live accord to the ip. Thus the language where you live could be determined, and a preferred set of pages can be assign to response to you.

It seems that this kind of webside must know which ip is correspondent to which country, corresponding to a specific language. Or some website prove a service for determining the country according to a IP, thus the forgoing website can get the response from the service for forwarding you to the preferred set of pages.

Could anyone share useful information about this or useful tools to do it? PHP scripts is preferred. Thank you for reading my post.

Reply

Saint_Michael
hers are some useful websites to help you out but you would have to search thgouh alot of scripts to find waht your looking ofr though.

http://www.trimmail.com/tools
http://www.dnsstuff.com/

Reply

snlildude87
*moved to the PHP forum since you mentioned PHP scripts*

Actually, Mike, dnsstuff won't work since it doesn't really provide any scripts....

Reply

palladin
Checked by IP is not perfect. I prefer checking by explorer leanguage accept.

Somthing like this, from one of my pages: (they check is explorer accept PL leanguage, polish, my orygin)

CODE

<?php
$lang = getenv('HTTP_ACCEPT_LANGUAGE');
$lang = preg_replace('/(;q=[0-9]+.[0-9]+)/i','',$lang);
$lang_array = explode(",", $lang);
$i=0;
$isPL = FALSE;
$isEN = FALSE;
while ($i != 10)
{
 $language = strtolower($lang_array[$i]);
 $language = substr ($language, 0, 2);
 if ( $language != '' )
 {
   if ( $language == 'pl' ) {$isPL = TRUE;} else {$isEN = TRUE;}
 }
 $i++;
}

if ($isPL == TRUE)
{
 // POLISH CONTENT
}
else
{
 // EANGLISH CONTENT
}

?>


You can put more then one option ... i leave this for future.


--------------------

Practice is when evrything is work but no one know why.
Theory is when work nothing but evry one know why.
Programmers join Practice with Theory - nothing work and no one know why cool.gif

 

 

 


Reply

Saint_Michael
meh i was more like using them for referances on what they were looking for, cuz i had a hard time looking for scripts that fall in the lines of what whistle was looking for.

Reply

whistle
QUOTE(snlildude87 @ Jul 24 2005, 11:25 PM)
*moved to the PHP forum since you mentioned PHP scripts*

*



Actually, this thread was on other forum and moved to here by Buffalohelp. unsure.gif

QUOTE(palladin @ Jul 25 2005, 05:51 AM)
Checked by IP is not perfect. I prefer checking by explorer leanguage accept.

*



Thanks for your help. Your scripts are simple and easy to be understood. It is really another way to reach the same target. If I can't find the scripts related to the country IP, it must be the best way.

For the script, I have a question. If I query and get a response in Polish version because the language setting in my browser is Polish. Will my browser be changed to english version when I change the language setting to English?

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : url ip


    Looking for forward, url, ip

Searching Video's for forward, url, ip
advertisement



How To Forward Url According To The Ip?



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE