PDA

Click to See Complete Forum and Search --> : sending/retrieving URL of requesting page to/from an included page?


solitario
Feb 28th, 2006, 01:29 PM
Hello all.
I've got a PHP page:
http://localhost/c/folder1/index.php

On the above page I have the following code:
include_once('http://localhost/c/folder2/index.php');
On http://localhost/c/folder2/index.php I have the following 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:

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.
OR
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.