Oh, of course; including the page via a URL; that would make the difference.
The user makes a request to the web server, and the script that runs as a result sends an entirely new request to the web server. There is nothing to indicate to the web server that the two requests have anything to do with each other, so it has no way of knowing that the request-URI of the first request has anything to do with the running of the second request.
Practical upshot is that you'll have to send the request-URI of the first request to the second yourself (I'm assuming that the different domains indicates that you can't just use filenames to include the script). I guess you could attach it to the URL something similar to
require('http://www.programdomain.com/program.php?referer='
. urlencode($_SERVER['REQUEST_URI']));
And then read $_GET['referer'].