0

I got the following problem - I am trying to make a web service in PHP, which needs to find out from which IP the request was done and store it. Right now, code looks like this:

function postConnectionRequest($a,$b){
  // I need to get requester's IP here to store it.
  return 0;
}
 
$server=new SoapServer("test.wsdl");
$server->addFunction("postConnectionRequest");
$server->handle();

How can I get it? Searched for hours, cant find the way, maybe as I am returning to PHP after 15 years and thinking too much C#ish ;)

M. Eriksson
  • 13,450
  • 4
  • 29
  • 40
Petr Osipov
  • 621
  • 6
  • 16
  • 1
    Was googling for a while, but focusing too much on SoapServer, while the method is more global. Actually thats the thinking way - I fully forgot that each PHP start is from some IP request, other then with desktop applications I was doing for last 15 years ;) – Petr Osipov Jul 01 '20 at 08:06
  • Fair enough. It's not always easy switching focus :-) – M. Eriksson Jul 01 '20 at 08:07

0 Answers0