Forum Moderators: coopster

Message Too Old, No Replies

check server ip address (not client)

         

jackvull

2:33 pm on Jul 4, 2006 (gmt 0)

10+ Year Member



Hi
I have a page, which runs a script on another server through an iframe.

I'd like the script on the second server to check the ip address the request came from for security, so I know it has only originated from my server. I know of $_SERVER['REMOTE_ADDR'] but this seems to display the client address, i.e. calling the page from server 1.

Any ideas?

Sekka

3:04 pm on Jul 4, 2006 (gmt 0)

10+ Year Member



That's because the client is technically loading the page, not the server.

You could pass a code to the file on the other server to verify the request came from your server, or you could make it check the parent document using JS, etc.

The originating server, aka the IP address you want, won't actually be known to the file on the other server as it never actually interacts with your server, only the user via the iFrame.