Alex Rivera | Logout

How can I get the client's IP address in a PHP webservice?

Asked 2009-09-17T09:47:55.620
31

I have developed a PHP webservice. I would like to log all incoming connections of the WS clients, which are consuming this web service. How can I obtain the client's IP address? The value of

$_SERVER['HTTP_CLIENT_IP']
seems to be always empty.

Edit
Report

1 Answer

2

Are you using some kind of framework for your webservice? I saw some frameworks (For instance Agavi) which intentionally delete all the $SERVER data because they want to enfore you to use the validated values from a framework service.

answered 2009-09-17T09:59:50.090

Your Answer