Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

geoip_id_by_name(3) [php man page]

GEOIP_ID_BY_NAME(3)							 1						       GEOIP_ID_BY_NAME(3)

geoip_id_by_name - Get the Internet connection type

SYNOPSIS
int geoip_id_by_name (string $hostname) DESCRIPTION
The geoip_id_by_name(3) function will return the Internet connection type corresponding to a hostname or an IP address. The return value is numeric and can be compared to the following constants: o GEOIP_UNKNOWN_SPEED o GEOIP_DIALUP_SPEED o GEOIP_CABLEDSL_SPEED o GEOIP_CORPORATE_SPEED PARAMETERS
o $hostname - The hostname or IP address whose connection type is to be looked-up. RETURN VALUES
Returns the connection type. EXAMPLES
Example #1 A geoip_id_by_name(3) example This will output the connection type of the host example.com. <?php $netspeed = geoip_id_by_name('www.example.com'); echo 'The connection type is '; switch ($netspeed) { case GEOIP_DIALUP_SPEED: echo 'dial-up'; break; case GEOIP_CABLEDSL_SPEED: echo 'cable or DSL'; break; case GEOIP_CORPORATE_SPEED: echo 'corporate'; break; case GEOIP_UNKNOWN_SPEED: default: echo 'unknown'; } ?> The above example will output: The connection type is corporate PHP Documentation Group GEOIP_ID_BY_NAME(3)

Check Out this Related Man Page

GEOIP_COUNTRY_CODE_BY_NAME(3)						 1					     GEOIP_COUNTRY_CODE_BY_NAME(3)

geoip_country_code_by_name - Get the two letter country code

SYNOPSIS
string geoip_country_code_by_name (string $hostname) DESCRIPTION
The geoip_country_code_by_name(3) function will return the two letter country code corresponding to a hostname or an IP address. PARAMETERS
o $hostname - The hostname or IP address whose location is to be looked-up. RETURN VALUES
Returns the two letter ISO country code on success, or FALSE if the address cannot be found in the database. EXAMPLES
Example #1 A geoip_country_code_by_name(3) example This will print where the host example.com is located. <?php $country = geoip_country_code_by_name('www.example.com'); if ($country) { echo 'This host is located in: ' . $country; } ?> The above example will output: This host is located in: US NOTES
Caution Please see http://www.maxmind.com/en/iso3166 for a complete list of possible return values, including special codes. SEE ALSO
geoip_country_code3_by_name(3), geoip_country_name_by_name(3). PHP Documentation Group GEOIP_COUNTRY_CODE_BY_NAME(3)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

restart case ?

simple short question... when you make a case instruction.. read f echo " " case $f in 0) echo "0" ;; 1) echo "1" ;; 2) echo "2" ;; *) echo "unknown";; # how to restart case from line 'read f' ? esac ...just wanna get to the entry when making a false entry. there isn't a... (3 Replies)
Discussion started by: svennie
3 Replies

2. AIX

end of case

hello How can I go out to a "case" boucle, but not finish the program : echo " your choice :" read grp1 do case ${grp1} in 1)grp1="toto1";; 2)grp1="toto2";; 3)grp1="toto3";; 4)grp1="toto4";; 5)grp1=t;; 6)grp1=t;; ... (3 Replies)
Discussion started by: pascalbout
3 Replies

3. Shell Programming and Scripting

greater than less than in case

Hi , I want to do the following: i=6 case $i in -lt 10) echo Period=10 ;; -gt 10 && -lt 15) echo Period-15 ;; >15 && <20) echo Period=20 ;; >20 && <30) ... (2 Replies)
Discussion started by: sars
2 Replies

4. Windows & DOS: Issues & Discussions

Switching from dial-up to DSL on Windows

I have been using dial up for my internet connection for the past 6 months on Windows. Before that, I used DSL. Now, I am trying to switch back to DSL but I can't connect to internet on my Windows. there is no problem, I am sure, on the DSL connection, since I have dual-boot Linux installed and... (3 Replies)
Discussion started by: milhan
3 Replies

5. Shell Programming and Scripting

Using variable in case statement

I want to do this: Ex 1: case $answer in 1|2|3|4|5) echo $answer;; x) break;; *) echo "Invalid selection. Try again.";; esac But I need the part "1|2|3|4|5" to be fetched from a variable, like so: Ex 2: case $answer in $cases) echo $answer;; x) break;; *) echo "Invalid... (2 Replies)
Discussion started by: fialia
2 Replies

6. UNIX for Dummies Questions & Answers

How to combine case statements

Hi, I need to change military time to regular time. I know to use case to indicate whether a.m. or p.m. as follows: case "$hour" in 0? | 1 ) echo a.m.;; 1 ) echo p.m.;; * ) echo p.m.;; esac My question is how do I add the hour and minute... (2 Replies)
Discussion started by: karp3158
2 Replies

7. IP Networking

Problems with Internet setup

Hi, I am using VMWARE and when I have the network connection set to NAT and the VM set to DHCP I get internet connection. But when I set the connection to BRIDGED and assign a static IP address I loose internet connection. I have used netconfig to manually assign the IP Address, GATEWAY, and... (5 Replies)
Discussion started by: mojoman
5 Replies

8. UNIX for Dummies Questions & Answers

Crontab

That should echo Machine name and then the hostnames command into the test file every minute shouldnt it? Cant seem to get it working. (4 Replies)
Discussion started by: RAFC_99
4 Replies

9. UNIX for Advanced & Expert Users

case-function issue

This is my code *************** #!/bin/bash echo -e "no: \c" read no case $no in 1)fun;; *)echo "wrong";; esac fun() { echo "in" } this is my output error ***************** (2 Replies)
Discussion started by: ponmuthu
2 Replies

10. AIX

create file and name it with same output name !

Guy's I have this command echo $? when I type it in AIX it will showme 0 I want when I type that command to create file in the same location with the same output of echo $? For exampl : I will execute the command now .... P_server/root/echo $? 0 the output is 0 so I want... (2 Replies)
Discussion started by: Mr.AIX
2 Replies

11. IP Networking

Multiple wan connection on single PC

Hi All Is it possible to be connected to a corporate lan/wan through the on-baord nic, and also be connected to mobile wan through a tethered smartphone? Ideally I'd like to be able to use my own smartphone using a browser like chrome (private browsing) while still being able to use the... (3 Replies)
Discussion started by: huskie69
3 Replies

12. Shell Programming and Scripting

anyone can explain this?

why the case 2 will happen ? , ' should stop the history substitution ,shouldn't it? case 1 # echo "123"|sed '/123/!d' 123 case 2 # echo "123 > 456 > 1 > "|sed '/123/!d' -bash: !d': event not found case 3 # echo "123 > 456 > 12 > "|sed '/123/'\!d 123 # bash --version (1 Reply)
Discussion started by: justlooks
1 Replies

13. SuSE

Suse Linux 11.4 Internet connection

Hi I am new to Linux. I installed 11.4, it went smooth and everything was working fine. After Update i rebooted the system and all of sudden internet connection is not working. Could any one tell me how to check and change the settings. Rgds Kashch (1 Reply)
Discussion started by: kashch
1 Replies

14. Programming

Missing Logic Looping Through Switch Statement

Having trouble with the logic when looping over this switch case again: for (j = 0; data != 0; j++){ switch(data){ case 'c': output = ranit(r_brace_array); break; case 'h': output = ranit(pipe_array); break; ... (6 Replies)
Discussion started by: Azrael
6 Replies

15. Shell Programming and Scripting

How to print last character of hostname and assign to a variable ?

Hi How to pass echo output to a variable ? Does below awk command will get the last character of hostname and assign to a variable - "svr" ? svr=$( echo `hostname` | awk '{print substr($0,length,1)}' ) Thanks. Please use CODE tags when dsplaying code segments, sample input, and sample... (7 Replies)
Discussion started by: Lim
7 Replies