IP Addresses

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
xstevey_bx
Forum Newbie
Posts: 1
Joined: Tue Nov 11, 2008 2:00 pm

IP Addresses

Post by xstevey_bx »

I have a university project that I need to work on and part of it will require me assigning users a specific avatar when they log into the site.

To shake things up a little and remove the totally random aspect I want to set up ranges of IP addresses which each correspond to one of the avatars. This means that users from different areas will have a higher probability of recieving an avatar than users in another.

There are 4,200,000,000 odd Ip4 addresses and I need to split them up into 1000 ranges. How do Ip addresses incriment?

They start at 0.0.0.0, but is the next one 0.0.0.1?

What happens once the address reaches 0.0.0.255? Is the next one 0.0.1.0?

Any help or suggestions would be greatly appreciated!!
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: IP Addresses

Post by Mark Baker »

I suggest you spend a little time learning about IP addresses, and particularly the different classes.
Wikipedia might be a good place to start
Post Reply