Why not ask the author for permission to reuse its code ?
If you read the code of this page, you will find a piece of Javascript code that do all the calculation in this page.
IP calculation is not rocket science, there is not need to resort to PHP.
[Update]
Quote:
because I begin to learn made website, so I don't know how to put code into my page, can you tell me
Here is a good site to learn HTML, CSS, JavaScript, PHP and others.
W3Schools Online Web Tutorials[
^]