stormen81 Posted October 7, 2009 Share Posted October 7, 2009 I am building a CMS on my Windows system. I am trying to log the IP address in to a MYSQL Database. I have no issues getting the IP address or MYSQL but here is the problem. When I take the $_SERVER['REMOTE_ADDR'] and try to do something like this: $ip = "update " . $_SERVER['REMOTE_ADDR'] . " to db"; I get an error say the unable to do this line "x". I check it and it is the line with the $_SERVER['REMOTE']. Is there a way to parse the $_SERVER['REMOTE_ADDR']? I have notice that SMF does parsing of the $_SERVER['REMOTE_ADDR'] and logs in the MYSQL db without an issue. I am using a XAMPP server on my windows XP... I am not sure if this a windows only issue yet... I need to try this on my MacBook with the OSX version of XAMPP. Thanks for any help. Stormen Quote Link to comment https://forums.phpfreaks.com/topic/176870-_serverremote_addr-problem-on-windows/ Share on other sites More sharing options...
zq29 Posted October 7, 2009 Share Posted October 7, 2009 Errors are not always on the line that the PHP interpreter says they're on, it could be on a line or two above - You might be missing a semi-colon on the line above, for example. Quote Link to comment https://forums.phpfreaks.com/topic/176870-_serverremote_addr-problem-on-windows/#findComment-932582 Share on other sites More sharing options...
stormen81 Posted October 7, 2009 Author Share Posted October 7, 2009 That is not the case ... I comment the query string and mysql function and it works perfectly. Quote Link to comment https://forums.phpfreaks.com/topic/176870-_serverremote_addr-problem-on-windows/#findComment-932607 Share on other sites More sharing options...
mikesta707 Posted October 7, 2009 Share Posted October 7, 2009 maybe post the code or the actual error message? Quote Link to comment https://forums.phpfreaks.com/topic/176870-_serverremote_addr-problem-on-windows/#findComment-932610 Share on other sites More sharing options...
stormen81 Posted October 7, 2009 Author Share Posted October 7, 2009 Found my error before posting this. It was not the ";". I had a $this-pre when it should have been a $this->pre... ...which made the Fatal Catch error that was bugging me. I was kinda thinking it was something else. Thanks for the help. Stormen Quote Link to comment https://forums.phpfreaks.com/topic/176870-_serverremote_addr-problem-on-windows/#findComment-932653 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.