Author |
Message |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Mon Nov 13, 2006 8:14 pm Post subject: Alias - Ip |
 |
|
|
|
On the alias module that comes in ASSS, the ip is stored as an integer instead of the decimal form, how do I get it back into that decimal form in php? You might have seen my alias site that is linked the logic bot, well in logic bot the ip is stored as a plain ip. How can i convert this integer back into the decimal ip form? Thanks in advance.
Example: 192.168.1.104 = 3232235880 |
|
Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:42 Gender: Joined: Aug 01 2002 Posts: 3615 Location: Las Vegas Offline
|
Posted: Mon Nov 13, 2006 8:31 pm Post subject: |
 |
|
|
|
long2ip. Warning: depends on the byte order, so it may result in reverse numbering. |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Mon Nov 13, 2006 8:52 pm Post subject: |
 |
|
|
|
Thank you so much. This worked.
Nice job on the fast response time. <3  |
|
Back to top |
|
 |
Smong Server Help Squatter

Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Tue Nov 14, 2006 5:23 am Post subject: |
 |
|
|
|
If you look at the source to asss's alias module you can see there is a mysql function called inet_ntoa. _________________ ss news  |
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Tue Nov 14, 2006 7:45 am Post subject: |
 |
|
|
|
I did see that. I looked at it before I posted. |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Tue Nov 14, 2006 11:28 am Post subject: |
 |
|
|
|
That's a mysql function? I think it's a networking (Winsock/whatever linux uses) function. _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
|
Back to top |
|
 |
BDwinsAlt Agurus's Posse

Age:34 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Tue Nov 14, 2006 5:02 pm Post subject: |
 |
|
|
|
Nice, I thought it was a built in function in AS3 or something. I think it would be faster/better to just call the integer value from mysql then use long2ip. Calling the integer value, then calling the value of the integer in a decimal would mean putting a little more stress on the mysql server. I try to make everything load as fast and easy as possible.
If I notice the IPs not turning out right then I'll use the mysql function.
Thanks for helping me guys.
p.s. I know its not much for the sql server to do but I'm just picky about things. |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Wed Nov 15, 2006 11:30 am Post subject: |
 |
|
|
|
Crazy. Why'd they put that in mysql too? |
|
Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:42 Gender: Joined: Aug 01 2002 Posts: 3615 Location: Las Vegas Offline
|
Posted: Wed Nov 15, 2006 2:30 pm Post subject: |
 |
|
|
|
Because MySQL is usually a database behind an application running for multiple users. Since multiple users usually come from different locations, be it the Internet or on a LAN, IP storage is common. Since IPs are stored as numbers (4 bytes for IPv4, 16 bytes for IPv6), might as well support an easy to use interface for accessing those numbers. It is not like those couple of functions add much bloat. |
|
Back to top |
|
 |
|