Jump to content

$_SERVER['REMOTE_ADDR'] problem on windows


stormen81

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/176870-_serverremote_addr-problem-on-windows/
Share on other sites

Found my error before posting this.  It was not the ";".

I had a $this-pre when it should have been a $this->pre... :facewall: ...which made the Fatal Catch error that was bugging me.  I was kinda thinking it was something else.

 

Thanks for the help.

Stormen

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.