dbWriter Home
IP to Country Look up
Site Map

IP to Country DB

Free Databases:

ASP Code

ASP Links

VB Script functions:
Array
Case/Select
In String (inStr)
Replace

HTML code:
SELECT Color
SELECT Countries
SELECT Language
SELECT State/Province

SQL:

SQL Functions:
Delete leading Char
Get Browser
Long number from IP

Stored Procedures:

SQL Tricks:
Delete ALL duplicates
Delete dup records

MISC
IP Address Owner
MS SQL Server

Mortgage Calcs:
how much is my payment
Loan Amortization
Loan Calculator
Mortgage Calculator
Motrgage Pay Off

dbWriter License

Link to US

Links

Contact US
 

dbWriter IP to number ASP code

Find the long number from an IP.

<%
Function IPToNumber(IPaddress)
DIM i, pos, PrevPos, num

If IPaddress = "" Then
IPToNumber = "error"
Else
For i = 1 To 4
pos = InStr(PrevPos + 1, IPaddress, ".", 1)
If i = 4 Then
pos = Len(IPaddress) + 1
End If

on error resume next

IF NOT isnumeric(Mid(IPaddress, PrevPos + 1, pos - PrevPos - 1)) THEN
IPToNumber = "error"
exit function
end if

num = Int(Mid(IPaddress, PrevPos + 1, pos - PrevPos - 1))
IF num >255 or num="" THEN
IPToNumber = "error"
exit function
END IF

PrevPos = pos
IPToNumber = ((num Mod 256) * (256 ^ (4 - i))) + IPToNumber
Next
End If
End Function

'======= un-comment next line to test
'response.write IPToNumber("26.39.143.55")
%>


 
updated 5/11/07
Partners/Links © 2005 - 2008 dbWriter.com All Rights Reserved
This site is protected by the dbWriter IPtoCountry MS/SQL database!!
Site map | Link to US
Contact Us

Sign up for PayPal and start accepting credit card payments instantly.