如何获取请求页面的URL或IP?

I happen to get xml file from http request like this

$xml = file_get_contents('php://input');

I then read and work on this xml file. But the issue is that i need to send an xml http request back to the requesting page... So, how do i get maybe the ip or url of this page to send my request back to?

You'd use $_SERVER['HTTP_REFERER'] (the referring URL, not always useful... and while "referer" is a misspelling of "referrer", that's how it is because someone typoed it in 1996) and $_SERVER['REMOTE_ADDR'] (the IP address accessing your page).