Friday 15 January 2010

Find a user's IP address within an action

Simple one but took some time to find the answer so I'm noting it here.

You could of course use standard PHP but that defeats the point of using a framework in my opinion...

But the quick answer is
$request->getHttpHeader('addr', 'remote'));

Easy :)

No comments:

Post a Comment

Please leave your feedback and comments. I love to discuss this stuff!