Login   Register  
PHP Classes
elePHPant
Icontem

Storeip: Store ip-addresses in a database

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2002-09-22 (12 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 1,467 All time: 2,483 This week: 1,748Up
Version License Categories  
storeip 1.0GNU General Public Lice...Networking, Databases
Description Author  

To Store ip-addresses in a database, you will
need a field type of Char(15).
This class let's you store the ipnumbers as
an integer ( between -2139062144 and 2139062143)

This class has two functions
1) decode ip->number
2) encode number->ip

Both functions return false for empty or wrong ip-numbers

While using this class you will spare typical 11 bytes
for every ipnumber you store.
Char(15) needs 15 Bytes
SIGNED INT(10) needs 4 Bytes

Picture of Bas Jobsen
Name: Bas Jobsen <contact>
Classes: 9 packages by
Country: The Netherlands The Netherlands
Age: 38
All time rank: 2356 in The Netherlands The Netherlands
Week rank: 1754 Down45 in The Netherlands The Netherlands Down

  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example
Accessible without login Plain text file license.txt Lic. license
Accessible without login Plain text file php_and_mysql.txt Doc. IMPORTANT
Plain text file storeip.php Class Storeip

 Version Control Unique User Downloads Download Rankings  
 0%Total:1,467All time:2,483
 This week:0This week:1,748Up