How do I find the IP address of the web server that calls my popup

We have an internal work application written in PHP that is called from another server. It acts like a popup.
Now our situation has changed where my app can be called from one of two servers.

Is there a way to find the IP address of the server that called my app?  I need to send commands back to the correct server using Curl when one of our agents presses a button on my form.

Thanks in advance!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
How is it being 'called'?  If it is on a web server, you can use the $_SERVER['REMOTE_ADDR'] to get it.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pootwaddleAuthor Commented:
There are 3 entities involved here.   My agent's PC and they are running a browser that is pointed to a URL on our dialer server.   When a call is connected, the dialer server (I believe) sends a URL ( to my agent's pc that pulls a url from our database server.

So the IP address I'm looking for is the dialer server IP.
pootwaddleAuthor Commented:
Oh, and just to disclose, even though I don't think it is material, we are using SSH for all the connections.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Ray PaseurCommented:
Run this script shown here in its entirety from a few different clients and compare the output near the bottom of the listing.  You'll find it!
<?php phpinfo();

Open in new window

Dave BaldwinFixer of ProblemsCommented:
Your description doesn't make any sense.  What is calling the PHP application that is going to use curl?  That is the IP address you need.  And unless your database server is also a web server, nothing is "pulling a URL" from it.
pootwaddleAuthor Commented:
Yes, sorry, our database server is a LAMP server,and it serves html pages as a popup as well as the data for the record that is to be worked on.

In the original configuration there were two servers and one client.  For the purpose here, one is an originating server and the other server serves up an html script (as a popup) with data from the record the agent is working.  The originating server is where our agents log in and initiate customer service calls.
Now there are two "originating servers" and my popup needs to know which originating
server called it so it can direct curl commands back to the correct server.

I might have to add a parameter in the url to differentiate which server made the call
for the popup.

Hope this helps clarify.

And I will also check out the information from phpinfo() to see if it gives me
what I need.

I know the two IP addresses,  I am just looking for a way that the popup can know which
of the two originating servers to send curl commands to.

pootwaddleAuthor Commented:
I'll try these solutions but I believe that I may have to make some application changes to really solve this problem
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.