GEOIP_ID_BY_NAME(3) 1 GEOIP_ID_BY_NAME(3)geoip_id_by_name - Get the Internet connection typeSYNOPSIS
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 codeSYNOPSIS
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)