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

Posted on 2013-10-19
Medium Priority
Last Modified: 2013-10-21
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!
Question by:pootwaddle
  • 4
  • 2
LVL 84

Accepted Solution

Dave Baldwin earned 750 total points
ID: 39585514
How is it being 'called'?  If it is on a web server, you can use the $_SERVER['REMOTE_ADDR'] to get it.  http://www.php.net/manual/en/reserved.variables.server.php

Author Comment

ID: 39585520
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.

Author Comment

ID: 39585525
Oh, and just to disclose, even though I don't think it is material, we are using SSH for all the connections.
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

LVL 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 750 total points
ID: 39585529
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

LVL 84

Expert Comment

by:Dave Baldwin
ID: 39585540
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.

Author Comment

ID: 39586120
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.


Author Closing Comment

ID: 39588870
I'll try these solutions but I believe that I may have to make some application changes to really solve this problem

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
The viewer will learn how to dynamically set the form action using jQuery.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question