Changing IP sent on header

From: Date: Fri, 02 May 2014 14:45:46 +0000
Subject: Changing IP sent on header
Groups: php.general 
Request: Send a blank email to php-general+get-323235@lists.php.net to get a copy of this message
Hello, I have a webservice which uses Soap to interact with clients, and I want to log which is the IP I'm receiving requests from. In a first moment, the requests will be sent directly from client machine, by their own implementation of soap client, and I can get their IPs looking on $_SERVER['REMOTE_ADDR'] variable, which's fitting perfectly at the moment. However, I've create a client page, which implements the soap client, for users who don't want to implement could use. The problem is: My page is callling the webservice by ajax, which is getting me some trouble to find the client IP who is using the system. The use case would look like: 1- The Client log into the system. 2- The Client access the "client page". 3- The Client click on "Begin Transaction". 4- System sends an ajax request to the server to begin the transaction. 5- System receive the ajax request, and call the soap function (SoapClient) to begin the transaction. 6- System (SoapServer) receive the request,save the Client IP and returns 1 for sucess. I have the right Client IP until setp #5 using the IP stored on $_SESSION on step #1. I thought that I could change the IP from REMOTE_ADDR when sending the request on step #5, but I haven't found a way to do that.. Anyone has an idea on how to solve this problem? -- Att, ____________________________________________________ Ricardo R Bonfim

« previous php.general (#323235) next »