ip

Block specific IP block from my website in PHP

I'd like, for example, block every IP from base 89.95 (89.95..). I don't have .htaccess files on my server, so I'll have to do it with PHP. if ($_SERVER['REMOTE_ADDR'] == "89.95.25.37") die(); Would block specific IP. How can I block entire IP blocks? Thank you very much. ...

How to block IP address or IP classes in ASP.NET

I need to block one IP address or class in asp.net Can anyone help me with the code? And how to implement? Thanks ...

Howto check if two hosts are the same

Hi, I just came across an issue, where I had to check if a path points into a windows share. Part of this problem is to check if host A is the same as host B. Where host A and host B can be one of the following {IPv4-Address, IPv6-Address, Hostname, FQDN}. As I do not need to be exact it's enough to resolve and compare the IP-Addresses ...

Error connecting java to mysql server after dialing up a modem

I juste installed mysql on my ubuntu box (lycid lynx) and try to connect to mysql trough java. Mysql is configured to allow only local connection. I can connect to mysql server with the mysql client locally and also i can with PHP. But from java no! I get this error "Host '....' is not allowed to connect to Mysql server". The address ip...

VB.Net Return IPv4 Address

How can I return the IPv4 address in VB.Net? eg. 192.168.1.5 ...

PHP/mysqli: Inserting IP address with mysqli_stmt_bind_param()

Hello! I have a database table which contains an unsigned integer field to store the visitor's IP address: `user_ip` INT(10) UNSIGNED DEFAULT NULL, Here's the snippet of PHP code which tries to store the IP address: $ipaddr = $_SERVER['REMOTE_ADDR']; if ($stmt = mysqli_prepare($dbconn, 'INSERT INTO visitors(user_email, user_ip) VALU...

Converting an IP address to a number:

Question: When I convert the IP address 192.168.115.67 to a number, is it done like this: 192*256^3 + 168*256^2+115*256^1+67*256^0 = 3232265027 or like this: 192*256^0 + 168*256^1+115*256^2+67*256^3 = 1131653312 I find both variants online, and frankly it doesn't matter as long as I do all the internal IP-range comparison using the sam...

HTTP: can GET and POST requests from a same machine come from different IPs?

I'm pretty sure I remember reading --but cannot find back the links anymore-- about this: on some ISP (including at least one big ISP in the U.S.) it is possible to have a user's GET and POST request appearing to come from different IPs. (note that this is totally programming related, and I'll give an example below) I'm not talking abo...

Relation between port and IP address

My question is, if machine A have two IP address X,Y. Can it open port 80 twice,like X:80 and Y:80 ? Say,is port unique by machine or by IP? ...

remote_addr problem

I am using xampp on localhost and when I use _SERVER["REMOTE_ADDR"] it returns ::1 (also does this in phpinfo()). Why does it do this? I want it to return a normal ip address like 127.0.0.1. My operating system is windows vista. ...

Converting CIDR address to subnet mask and network address

Given a CIDR address, e.g. 192.168.10.0/24 How to determine mask length? (24) How to determine mask address? (255.255.255.0) How to determine network address? (192.168.10.0) ...

how to get a byte[] representation from a IP in String form in Java

Suppose I have the IP stored in a String: String ip = "192.168.2.1" and I want to get the byte array with the four ints. How can I do it? Thanks! ...

Save IP in database

When a user logs in I want to save their IP in the database. How would I do that? What type is best to use for the MySQL field? How would the PHP code to get IP look like? I'm thinking of using it as an extra security feature for the login/session stuff. I'm thinking of checking the IP the user logged in with from the DB with the IP the...

Can you use an oveseas proxy to mask a US IP address?

Hello, This is a bit of an odd questions posed to me from a client. He owns a website, and his affiliates require him to have an overseas server.. HOWEVER, he does not trust the data, etc and likes the service he has with his existing dedicated server in the US. So, the question is.. can he 1) pay for an overseas co. to proxy the US IP,...

Finding Local IP via Socket Creation / getsockname

I need to get the IP address of a system within C++. I followed the logic and advice of another comment on here and created a socket and then utilized getsockname to determine the IP address which the socket is bound to. However, this doesn't appear to work (code below). I'm receiving an invalid IP address (58.etc) when I should be rece...

How to track my dynamic IP address,is there an API available or other tools?

Hi all, Does anyone know a tool or better an API to track my dynamic IP address? Thanks so much for your help. Yours, Ling ...

how to get ip address from sock structure in c ?

I'm writing simple server/client and trying to get client ip address and save it on server side to decide which client should get into critical section. I googled it several times but couldn't find proper way to get ip address from sock structure. I believe this is a way to get ip from sock struct after server accept request from client...

Setting the source IP for a UDP socket

I have a UDP socket that is bound to INADDR_ANY to listen to packets on all the IPs my server has. I'm sending out replies through the same socket. Right now the server chooses automatically which IP is used as the source IP when packets are sent out, but I would like to be able to set the outgoing source IP myself. Is there any way to...

php: ip2long returning negative val

hi, function ip_address_to_number($IPaddress) { if(!$IPaddress) { return false; } else { $ips = split('\.',$IPaddress); return($ips[3] + $ips[2]*256 + $ips[1]*65536 + $ips[0]*16777216); } } that function executes the same code as the php bundled function ip2long. however, when i print these 2 values, i get 2 different return...

php: showing my country based on my IP, mysql optimized

I've downloaded WIPmania's worldip table from http://www.wipmania.com/en/base/ -- the table has 3 fields and around 79k rows: startip // example: 3363110912 endip // example: 3363112063 country // example: AR (Argentina) So, lets suppose i'm in Argentina and my IP address is: 200.117.248.17 1) I use this function to convert my ip to...