Hello all.
I've got a PHP page:
http://localhost/c/folder1/index.php

On the above page I have the following code:
Code:
include_once('http://localhost/c/folder2/index.php');
On http://localhost/c/folder2/index.php I have the following code:
Code:
echo 'this is a test';
It works just fine, echoing the words this is a test to the requesting page.
But I was wondering, is there a way to:
  1. send the URL of the requesting page (http://localhost/c/folder1/index.php) to the page being included (http://localhost/c/folder2/index.php) without hard-coding it.
  2. OR
  3. retrieve the URL of the requesting page (http://localhost/c/folder1/index.php) from the page being included (http://localhost/c/folder2/index.php) without hard-coding it.

The ultimate goal being to validate the URL of the requesting page against a row in a database.

Any help in this is appreciated.
Many thanks.