Raised This Month: $ Target: $400
 0% 

Getting the first two octects of an IP address...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-05-2009 , 17:06   Re: Getting the first two octects of an IP address...
Reply With Quote #1

newip will contain the first two octets only, no matter if it is 8.69 or 123.238
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-05-2009 , 17:11   Re: Getting the first two octects of an IP address...
Reply With Quote #2

Or what about:
Code:
new ip[9], octet1[4], octet2[4]; get_user_ip(client, ip, sizeof(ip) - 1, 1); replace_all(ip, sizeof(ip) - 1, ".", " "); strbreak(ip, octet1, sizeof(octet1) - 1, ip, sizeof(ip) - 1); strbreak(ip, octet2, sizeof(octet2) - 1, ip, sizeof(ip) - 1); // octet1 contains first number // octet2 contains second number
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode