hello all, i am new to php programming. i want to send the name of the current page to the php page being included using include(). can anyone please help me???
Are you asking that the page your including to save the name as a variable to only allow traffic comming from a certain page for security? or affiliate type stuff? or am I way off?
I think he is asking us: How to let the included page know about the page which is including it. or simpler: how to let the child page(included page) know who the parent is (the page making the include() call) If yes, try the below: The parent file, which is including another file, lets call the included file as 'child.php' <?php include('child.php'); ?> PHP: Now, the 'child.php' <?php $parent=$_SERVER['REQUEST_URI']; echo 'This file was included by '.$parent; // will output: This file was included by /parent.php ?> PHP: