FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Get country where server stands.





TomS
Does anybody have an idea of how to find out where the server of a visitor stands. I mean something like Google. If you as german visit google.com you'll be sent to google.de.

Thanks.
Philip
ok here u go,

i have a table that have 4236 rows
and i coding my page that view 20 records every page,
so i need to count my how many page does i have

Code:
                              if (isset($_GET["searchtext"])){
                                 $sqlstatement=$sqlstatement." where nim like'%".$searchtext."%'";
                                 $sqlstatement=$sqlstatement." or nama like'%".$searchtext."%'";
                                 $sqlstatement=$sqlstatement." or skill like'%".$searchtext."%'";
                                 $sqlstatement=$sqlstatement." or username like'%".$searchtext."%'";
                              }
                              $sqlstatement=$sqlstatement." order by nim ";
                              $query=mysql_query($sqlstatement,$db);
                           $pertama=true;
                           $a1=true;
                           $a2=true;
[b]                            for ($i=1;$i<=ceil(mysql_num_rows($query)/$data_config["DATA_MEMBERS_SHOW"]);$i++)[/b]
                           {
                              if (($posisiberita+1)==$i)
                              {


nah in that bold code it seem the execution times is too long, maybe php count my pages by pages... --"
and print out
Fatal error: Maximum execution time of 60 seconds exceeded in

is there other way to count my pages ? thanks.
ganbate
just get the ip of the visitor's computer and use the ip to country database (search via google) to get the visitor's location.
after that just redirect the user to the desired page Wink
TomS
@Philip:
Is that my thread or yours?

@ganbate:
It was an idea, but doesn't it take quite long to communicate first with another site. An what, if their server is down for a while?

I know; the broser sends the language, but I don't know how to get this value. (phpcode odr even javascript)
ganbate
TomS wrote:

It was an idea, but doesn't it take quite long to communicate first with another site. An what, if their server is down for a while?

I know; the broser sends the language, but I don't know how to get this value. (phpcode odr even javascript)


i don't meant that you have to connect to their database server.
there's a ip to country database that was distributed for free. i have it once, but i forgot from where & now i can't find the file in my computer Crying or Very sad

with that database you can call it from your own server.
yjwong
You can use GeoDNS then do a header() redirect.
Philip
Quote:
@Philip:
Is that my thread or yours?


ah sorry wrong post hehe Razz
btw u need a ip databases that recorded a ip and knowledge ip that ip from where..
if only u have a big company maybe u can do that Razz

sorry about that post hehe Very Happy
TomS
So you mean, that IP's are given depending on country or region, like telefon-country-prefixes??? (0049 for germany eg)

And these information stand in a predefined database? Ok. I'll goole it.
Philip
TomS wrote:
So you mean, that IP's are given depending on country or region, like telefon-country-prefixes??? (0049 for germany eg)

And these information stand in a predefined database? Ok. I'll goole it.


that;s right, but i dunno if there;s a web services that give u a ip area. Wink
TomS
Thanks. I downloadet it last night. It seems to work.
Funny. It told me, I'm located in Stuttgart/Baden-Württemberg/Germany.
But I'm located in Munich/Bavaria/Germany. Lol.
But that's no problem. The Country is correct and that's all I want. Thanks again.
Related topics
Christopher Walken for President??
Not Voting is Reasonable for People Who Want Freedom
now its time for VDSL
PHP logging script
What's great about your country?
Frihost Radio
I'm starting a tour of UK football stadiums...
Visiting YOUR country
Does America help starve the world??
Moving to another country
how do you know you love someone?
Mindless faith
Fish tank anyone?
Is an island still a country after it sunk under sealevel ?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.