Raised This Month: $ Target: $400
 0% 

Help with SQL, it saves not only the IP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 01-05-2011 , 14:42   Help with SQL, it saves not only the IP
Reply With Quote #1

Code:
ip varchar(32)
PHP Code:
new szIp[32]
get_user_ip(idszIpcharsmax(szIp))
            
new 
szTemp[512]
        
format(szTemp,charsmax(szTemp),"INSERT INTO `something` (`ip`)VALUES ('%s');",szIp


The problem is it saves output such as:

Quote:
78.60.101.151:27005
78.56.130.238:27005
Why not just a IP, without port ...



I guess you could ask me why I'm saving something on users IP ? Because I'm writing a php website script where you don't have to log in, it automaticly identifies ur IP and redirects you into your user control panel where you can buy various things such as admin/vip/slot ... I can't detect users steam ID via php :[.
reinert is offline
t3hNox
Senior Member
Join Date: Oct 2009
Old 01-05-2011 , 14:53   Re: Help with SQL, it saves not only the IP
Reply With Quote #2

Change:
Code:
get_user_ip(id, szIp, charsmax(szIp))
to:
Code:
get_user_ip(id, szIp, charsmax(szIp), 1)
The output will be without port.
http://www.amxmodx.org/funcwiki.php?...r_ip&go=search
t3hNox is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 01-05-2011 , 15:21   Re: Help with SQL, it saves not only the IP
Reply With Quote #3

thanks, hope it works.
reinert 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:58.


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